mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-22 11:44:23 +02:00
changed item_id postfix in sensor from name to data_reference
This commit is contained in:
parent
efb0bd8069
commit
6f7057b8b3
1 changed files with 3 additions and 3 deletions
|
@ -81,15 +81,15 @@ def update_items(inst, config_entry, mikrotik_controller, async_add_entities, se
|
||||||
new_sensors = []
|
new_sensors = []
|
||||||
|
|
||||||
for sensor, sid_func in zip(
|
for sensor, sid_func in zip(
|
||||||
# Data point name
|
# Sensor type name
|
||||||
["environment"],
|
["environment"],
|
||||||
# Switch function
|
# Entity function
|
||||||
[
|
[
|
||||||
MikrotikControllerSensor,
|
MikrotikControllerSensor,
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
for uid in mikrotik_controller.data[SENSOR_TYPES[sensor].data_path]:
|
for uid in mikrotik_controller.data[SENSOR_TYPES[sensor].data_path]:
|
||||||
item_id = f"{inst}-{sensor}-{mikrotik_controller.data[sensor][uid][SENSOR_TYPES[sensor].data_uid]}"
|
item_id = f"{inst}-{sensor}-{mikrotik_controller.data[sensor][uid][SENSOR_TYPES[sensor].data_reference]}"
|
||||||
_LOGGER.debug("Updating sensor %s", item_id)
|
_LOGGER.debug("Updating sensor %s", item_id)
|
||||||
if item_id in sensors:
|
if item_id in sensors:
|
||||||
if sensors[item_id].enabled:
|
if sensors[item_id].enabled:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue