Removed extended debugging info from sensors. Added descriptive method on route info.
parent
01058a07b4
commit
7d1494f29b
|
|
@ -78,7 +78,11 @@ class Routes:
|
||||||
"""
|
"""
|
||||||
for route in self.routes.values():
|
for route in self.routes.values():
|
||||||
if route.url_path == url_path:
|
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.enabled = True
|
||||||
route.handler = handler
|
route.handler = handler
|
||||||
else:
|
else:
|
||||||
|
|
@ -102,7 +106,7 @@ class Routes:
|
||||||
self.routes[key] = RouteInfo(
|
self.routes[key] = RouteInfo(
|
||||||
url_path, route=route, handler=handler, enabled=enabled
|
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:
|
def show_enabled(self) -> str:
|
||||||
"""Return a human-readable description of the currently enabled route."""
|
"""Return a human-readable description of the currently enabled route."""
|
||||||
|
|
|
||||||
|
|
@ -233,15 +233,6 @@ class WeatherSensor( # pyright: ignore[reportIncompatibleVariableOverride]
|
||||||
|
|
||||||
description = cast("WeatherSensorEntityDescription", self.entity_description)
|
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:
|
if description.value_from_data_fn is not None:
|
||||||
try:
|
try:
|
||||||
value = description.value_from_data_fn(data)
|
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
|
"native_value compute failed via value_from_data_fn for key=%s", key
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
if self._dev_log:
|
|
||||||
_LOGGER.debug(
|
|
||||||
"native_value computed via value_from_data_fn: key=%s -> %s",
|
|
||||||
key,
|
|
||||||
value,
|
|
||||||
)
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
raw = data.get(key)
|
raw = data.get(key)
|
||||||
|
|
@ -277,14 +263,6 @@ class WeatherSensor( # pyright: ignore[reportIncompatibleVariableOverride]
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if self._dev_log:
|
|
||||||
_LOGGER.debug(
|
|
||||||
"native_value computed via value_fn: key=%s raw=%s -> %s",
|
|
||||||
key,
|
|
||||||
raw,
|
|
||||||
value,
|
|
||||||
)
|
|
||||||
|
|
||||||
return value
|
return value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,9 @@ from .const import (
|
||||||
CH2_BATTERY,
|
CH2_BATTERY,
|
||||||
CH2_HUMIDITY,
|
CH2_HUMIDITY,
|
||||||
CH2_TEMP,
|
CH2_TEMP,
|
||||||
|
CH3_BATTERY,
|
||||||
CH3_HUMIDITY,
|
CH3_HUMIDITY,
|
||||||
CH3_TEMP,
|
CH3_TEMP,
|
||||||
CH3_BATTERY,
|
|
||||||
CH4_BATTERY,
|
CH4_BATTERY,
|
||||||
CH4_HUMIDITY,
|
CH4_HUMIDITY,
|
||||||
CH4_TEMP,
|
CH4_TEMP,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue