From 7d1494f29b0069fbad7be7a5fdb6811bef2d62eb Mon Sep 17 00:00:00 2001 From: SchiZzA Date: Sun, 1 Mar 2026 17:32:36 +0100 Subject: [PATCH] Removed extended debugging info from sensors. Added descriptive method on route info. --- custom_components/sws12500/routes.py | 8 +++++-- custom_components/sws12500/sensor.py | 24 +------------------- custom_components/sws12500/sensors_wslink.py | 2 +- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/custom_components/sws12500/routes.py b/custom_components/sws12500/routes.py index bab33aa..4e0b278 100644 --- a/custom_components/sws12500/routes.py +++ b/custom_components/sws12500/routes.py @@ -78,7 +78,11 @@ class Routes: """ for route in self.routes.values(): if route.url_path == url_path: - _LOGGER.info("New coordinator to route: %s", route.url_path) + _LOGGER.info( + "New coordinator to route: (%s):%s", + route.route.method, + route.url_path, + ) route.enabled = True route.handler = handler else: @@ -102,7 +106,7 @@ class Routes: self.routes[key] = RouteInfo( url_path, route=route, handler=handler, enabled=enabled ) - _LOGGER.debug("Registered dispatcher for route %s", url_path) + _LOGGER.debug("Registered dispatcher for route (%s):%s", route.method, url_path) def show_enabled(self) -> str: """Return a human-readable description of the currently enabled route.""" diff --git a/custom_components/sws12500/sensor.py b/custom_components/sws12500/sensor.py index 44c4b99..d1498d8 100644 --- a/custom_components/sws12500/sensor.py +++ b/custom_components/sws12500/sensor.py @@ -233,15 +233,6 @@ class WeatherSensor( # pyright: ignore[reportIncompatibleVariableOverride] description = cast("WeatherSensorEntityDescription", self.entity_description) - if self._dev_log: - _LOGGER.debug( - "native_value start: key=%s, has_value_from_data_fn=%s, has_value_fn=%s, data_keys=%s", - key, - description.value_from_data_fn is not None, - description.value_fn is not None, - sorted(data), - ) - if description.value_from_data_fn is not None: try: value = description.value_from_data_fn(data) @@ -250,12 +241,7 @@ class WeatherSensor( # pyright: ignore[reportIncompatibleVariableOverride] "native_value compute failed via value_from_data_fn for key=%s", key ) return None - if self._dev_log: - _LOGGER.debug( - "native_value computed via value_from_data_fn: key=%s -> %s", - key, - value, - ) + return value raw = data.get(key) @@ -277,14 +263,6 @@ class WeatherSensor( # pyright: ignore[reportIncompatibleVariableOverride] ) return None - if self._dev_log: - _LOGGER.debug( - "native_value computed via value_fn: key=%s raw=%s -> %s", - key, - raw, - value, - ) - return value @property diff --git a/custom_components/sws12500/sensors_wslink.py b/custom_components/sws12500/sensors_wslink.py index b431af2..d2051a3 100644 --- a/custom_components/sws12500/sensors_wslink.py +++ b/custom_components/sws12500/sensors_wslink.py @@ -20,9 +20,9 @@ from .const import ( CH2_BATTERY, CH2_HUMIDITY, CH2_TEMP, + CH3_BATTERY, CH3_HUMIDITY, CH3_TEMP, - CH3_BATTERY, CH4_BATTERY, CH4_HUMIDITY, CH4_TEMP,