Breaking change: change mqtt entity ids

This commit is contained in:
Linus Dietz
2023-06-22 15:48:03 +02:00
parent e1e31776c2
commit e0152fa82d
+5 -6
View File
@@ -133,10 +133,9 @@ def create_ha_devices():
for device_tracker in supported_device_trackers: for device_tracker in supported_device_trackers:
config = { config = {
"name": device_tracker['name'], "name": device_tracker['name'],
"object_id": device_tracker['id'], "object_id": f"volvo_{vin}_{device_tracker['id']}",
"schema": "state", "schema": "state",
"icon": f"mdi:{device_tracker['icon']}", "icon": f"mdi:{device_tracker['icon']}",
"state_topic": f"homeassistant/device_tracker/{vin}_{device_tracker['id']}/state", "state_topic": f"homeassistant/device_tracker/{vin}_{device_tracker['id']}/state",
"device": device, "device": device,
"unique_id": f"volvoAAOS2mqtt_{vin}_{device_tracker['id']}", "unique_id": f"volvoAAOS2mqtt_{vin}_{device_tracker['id']}",
@@ -151,7 +150,7 @@ def create_ha_devices():
command_topic = f"homeassistant/button/{vin}_{button['id']}/command" command_topic = f"homeassistant/button/{vin}_{button['id']}/command"
config = { config = {
"name": button['name'], "name": button['name'],
"object_id": button['id'], "object_id": f"volvo_{vin}_{button['id']}",
"schema": "state", "schema": "state",
"icon": f"mdi:{button['icon']}", "icon": f"mdi:{button['icon']}",
"state_topic": f"homeassistant/button/{vin}_{button['id']}/state", "state_topic": f"homeassistant/button/{vin}_{button['id']}/state",
@@ -170,7 +169,7 @@ def create_ha_devices():
command_topic = f"homeassistant/lock/{vin}_{lock['id']}/command" command_topic = f"homeassistant/lock/{vin}_{lock['id']}/command"
config = { config = {
"name": lock['name'], "name": lock['name'],
"object_id": lock['id'], "object_id": f"volvo_{vin}_{lock['id']}",
"schema": "state", "schema": "state",
"icon": f"mdi:{lock['icon']}", "icon": f"mdi:{lock['icon']}",
"state_topic": f"homeassistant/lock/{vin}_{lock['id']}/state", "state_topic": f"homeassistant/lock/{vin}_{lock['id']}/state",
@@ -190,7 +189,7 @@ def create_ha_devices():
command_topic = f"homeassistant/switch/{vin}_{switch['id']}/command" command_topic = f"homeassistant/switch/{vin}_{switch['id']}/command"
config = { config = {
"name": switch['name'], "name": switch['name'],
"object_id": switch['id'], "object_id": f"volvo_{vin}_{switch['id']}",
"schema": "state", "schema": "state",
"icon": f"mdi:{switch['icon']}", "icon": f"mdi:{switch['icon']}",
"state_topic": f"homeassistant/switch/{vin}_{switch['id']}/state", "state_topic": f"homeassistant/switch/{vin}_{switch['id']}/state",
@@ -209,7 +208,7 @@ def create_ha_devices():
for sensor in supported_sensors: for sensor in supported_sensors:
config = { config = {
"name": sensor['name'], "name": sensor['name'],
"object_id": sensor['id'], "object_id": f"volvo_{vin}_{sensor['id']}",
"schema": "state", "schema": "state",
"icon": f"mdi:{sensor['icon']}", "icon": f"mdi:{sensor['icon']}",
"state_topic": f"homeassistant/sensor/{vin}_{sensor['id']}/state", "state_topic": f"homeassistant/sensor/{vin}_{sensor['id']}/state",