diff --git a/custom_components/mikrotik_router/binary_sensor.py b/custom_components/mikrotik_router/binary_sensor.py index 3374fc6..428f5b9 100644 --- a/custom_components/mikrotik_router/binary_sensor.py +++ b/custom_components/mikrotik_router/binary_sensor.py @@ -65,6 +65,7 @@ def update_items(inst, mikrotik_controller, async_add_entities, sensors): for sensor in SENSOR_TYPES: item_id = f"{inst}-{sensor}" + _LOGGER.debug("Updating binary_sensor %s", item_id) if item_id in sensors: if sensors[item_id].enabled: sensors[item_id].async_schedule_update_ha_state() diff --git a/custom_components/mikrotik_router/device_tracker.py b/custom_components/mikrotik_router/device_tracker.py index cd1aaa0..0688ce0 100644 --- a/custom_components/mikrotik_router/device_tracker.py +++ b/custom_components/mikrotik_router/device_tracker.py @@ -82,9 +82,8 @@ def update_items(inst, mikrotik_controller, async_add_entities, tracked): for uid in mikrotik_controller.data["interface"]: if mikrotik_controller.data["interface"][uid]["type"] == "ether": - item_id = ( - f"{inst}-{mikrotik_controller.data['interface'][uid]['default-name']}" - ) + item_id = f"{inst}-{mikrotik_controller.data['interface'][uid]['default-name']}" + _LOGGER.debug("Updating device_tracker %s", item_id) if item_id in tracked: if tracked[item_id].enabled: tracked[item_id].async_schedule_update_ha_state() diff --git a/custom_components/mikrotik_router/sensor.py b/custom_components/mikrotik_router/sensor.py index 5a883a2..0fccbc9 100644 --- a/custom_components/mikrotik_router/sensor.py +++ b/custom_components/mikrotik_router/sensor.py @@ -103,6 +103,7 @@ def update_items(inst, mikrotik_controller, async_add_entities, sensors): for sensor in SENSOR_TYPES: if "traffic_" not in sensor: item_id = f"{inst}-{sensor}" + _LOGGER.debug("Updating sensor %s", item_id) if item_id in sensors: if sensors[item_id].enabled: sensors[item_id].async_schedule_update_ha_state() @@ -116,9 +117,9 @@ def update_items(inst, mikrotik_controller, async_add_entities, sensors): if "traffic_" in sensor: for uid in mikrotik_controller.data["interface"]: - if mikrotik_controller.data["interface"][uid][ - "type"] == "ether": + if mikrotik_controller.data["interface"][uid]["type"] == "ether": item_id = f"{inst}-{sensor}-{mikrotik_controller.data['interface'][uid]['default-name']}" + _LOGGER.debug("Updating sensor %s", item_id) if item_id in sensors: if sensors[item_id].enabled: sensors[item_id].async_schedule_update_ha_state() diff --git a/custom_components/mikrotik_router/switch.py b/custom_components/mikrotik_router/switch.py index 81cb12f..fc7aeab 100644 --- a/custom_components/mikrotik_router/switch.py +++ b/custom_components/mikrotik_router/switch.py @@ -115,6 +115,7 @@ def update_items(inst, mikrotik_controller, async_add_entities, switches): ): for uid in mikrotik_controller.data[sid]: item_id = f"{inst}-{sid}-{mikrotik_controller.data[sid][uid]['name']}" + _LOGGER.debug("Updating switch %s", item_id) if item_id in switches: if switches[item_id].enabled: switches[item_id].async_schedule_update_ha_state()