|
@@ -36,15 +36,15 @@ def create_config(client: mqtt.Client) -> None:
|
|
|
|
|
|
# Define discovery and state topics for each sensor
|
|
|
discovery_topic_disc = f"homeassistant/sensor/floppy_player/current_disc/config"
|
|
|
- state_topic_disc = f"homeassistant/sensor/floppy_player/current_disc/state"
|
|
|
+ current_disc_state_topic_disc = f"homeassistant/sensor/floppy_player/current_disc/state"
|
|
|
|
|
|
discovery_topic_status = f"homeassistant/sensor/floppy_player/status/config"
|
|
|
state_topic_status = f"homeassistant/sensor/floppy_player/status/state"
|
|
|
|
|
|
# Sensor 1: current_disc (a text-based sensor)
|
|
|
- disc_config = {
|
|
|
+ current_disc_config = {
|
|
|
"name": "Current Disc",
|
|
|
- "state_topic": state_topic_disc,
|
|
|
+ "state_topic": current_disc_state_topic_disc,
|
|
|
"value_template": "{{ value }}", # Textual value
|
|
|
"unique_id": f"{node_id}_current_disc",
|
|
|
"device": {
|
|
@@ -68,7 +68,7 @@ def create_config(client: mqtt.Client) -> None:
|
|
|
"manufacturer": "Karl"
|
|
|
}
|
|
|
}
|
|
|
- client.publish(discovery_topic_disc, json.dumps(disc_config), retain=True)
|
|
|
+ client.publish(discovery_topic_disc, json.dumps(current_disc_config), retain=True)
|
|
|
client.publish(discovery_topic_status, json.dumps(status_config), retain=True)
|
|
|
|
|
|
|