From efb0bd8069e76015da32a4748d5a90e96ba548d5 Mon Sep 17 00:00:00 2001 From: Tomaae Date: Wed, 2 Feb 2022 21:00:34 +0100 Subject: [PATCH] changed data source to data_path in sensor update loop --- custom_components/mikrotik_router/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/mikrotik_router/sensor.py b/custom_components/mikrotik_router/sensor.py index af8a7ad..f5989a7 100644 --- a/custom_components/mikrotik_router/sensor.py +++ b/custom_components/mikrotik_router/sensor.py @@ -88,7 +88,7 @@ def update_items(inst, config_entry, mikrotik_controller, async_add_entities, se MikrotikControllerSensor, ], ): - for uid in mikrotik_controller.data[sensor]: + 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]}" _LOGGER.debug("Updating sensor %s", item_id) if item_id in sensors: