From 4c9d3e32a1055fa511dc4eec63f12fdedd6c4dfb Mon Sep 17 00:00:00 2001 From: Chris Jowett <421501+cryptk@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:39:09 -0600 Subject: [PATCH] fix: improve logging for unsupported sensor, binary sensor and lights --- custom_components/omnilogic_local/binary_sensor.py | 5 ++++- custom_components/omnilogic_local/light.py | 5 ++++- custom_components/omnilogic_local/sensor.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/custom_components/omnilogic_local/binary_sensor.py b/custom_components/omnilogic_local/binary_sensor.py index 0976023..4872db1 100644 --- a/custom_components/omnilogic_local/binary_sensor.py +++ b/custom_components/omnilogic_local/binary_sensor.py @@ -89,7 +89,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e pass case _: _LOGGER.warning( - "Your system has an unsupported sensor, please raise an issue: https://github.com/cryptk/haomnilogic-local/issues" + "Your system has an unsupported sensor. ID: %s, Name: %s, Type: %s. Please raise an issue: https://github.com/cryptk/haomnilogic-local/issues", + sensor.msp_config.system_id, + sensor.msp_config.name, + sensor.msp_config.type, ) async_add_entities(entities) diff --git a/custom_components/omnilogic_local/light.py b/custom_components/omnilogic_local/light.py index 3e6c23f..49c806f 100644 --- a/custom_components/omnilogic_local/light.py +++ b/custom_components/omnilogic_local/light.py @@ -63,7 +63,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e entities.append(OmniLogicLightEntity(coordinator=coordinator, context=system_id)) case _: _LOGGER.warning( - "Your system has an unsupported light, this light may not function properly, please raise an issue: https://github.com/cryptk/haomnilogic-local/issues" + "Your system has an unsupported light. ID: %s, Name: %s, Type: %s. Please raise an issue: https://github.com/cryptk/haomnilogic-local/issues", + light.msp_config.system_id, + light.msp_config.name, + light.msp_config.type, ) async_add_entities(entities) diff --git a/custom_components/omnilogic_local/sensor.py b/custom_components/omnilogic_local/sensor.py index c8bfe1c..d495411 100644 --- a/custom_components/omnilogic_local/sensor.py +++ b/custom_components/omnilogic_local/sensor.py @@ -106,7 +106,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e pass case _: _LOGGER.warning( - "Your system has an unsupported sensor, please raise an issue: https://github.com/cryptk/haomnilogic-local/issues" + "Your system has an unsupported sensor. ID: %s, Name: %s, Type: %s. Please raise an issue: https://github.com/cryptk/haomnilogic-local/issues", + sensor.msp_config.system_id, + sensor.msp_config.name, + sensor.msp_config.type, ) # Create energy sensors for filters/pumps suitable for inclusion in the energy dashboard