mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Add Netatmo error logging when no public stations are available (#65298)
* Log error if public stations don't provide data Signed-off-by: cgtobi <cgtobi@gmail.com> * Only log once Signed-off-by: cgtobi <cgtobi@gmail.com> * Update homeassistant/components/netatmo/sensor.py Co-authored-by: Shay Levy <levyshay1@gmail.com> Co-authored-by: Shay Levy <levyshay1@gmail.com>
This commit is contained in:
parent
9f5d77e0df
commit
3718d7fca8
@ -839,15 +839,16 @@ class NetatmoPublicSensor(NetatmoBase, SensorEntity):
|
|||||||
elif self.entity_description.key == "guststrength":
|
elif self.entity_description.key == "guststrength":
|
||||||
data = self._data.get_latest_gust_strengths()
|
data = self._data.get_latest_gust_strengths()
|
||||||
|
|
||||||
if data is None:
|
if not data:
|
||||||
if self.state is None:
|
if self.available:
|
||||||
return
|
_LOGGER.error(
|
||||||
_LOGGER.debug(
|
|
||||||
"No station provides %s data in the area %s",
|
"No station provides %s data in the area %s",
|
||||||
self.entity_description.key,
|
self.entity_description.key,
|
||||||
self._area_name,
|
self._area_name,
|
||||||
)
|
)
|
||||||
self._attr_native_value = None
|
self._attr_native_value = None
|
||||||
|
|
||||||
|
self._attr_available = False
|
||||||
return
|
return
|
||||||
|
|
||||||
if values := [x for x in data.values() if x is not None]:
|
if values := [x for x in data.values() if x is not None]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user