Fix Netatmo indoor sensor (#116342)

* Debug netatmo indoor sensor

* Debug netatmo indoor sensor

* Fix
This commit is contained in:
Joost Lekkerkerker 2024-04-28 17:34:27 +02:00 committed by GitHub
parent 986df70fe3
commit 7a4aa3c40c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 6 deletions

View File

@ -529,7 +529,10 @@ class NetatmoWeatherSensor(NetatmoWeatherModuleEntity, SensorEntity):
@property @property
def available(self) -> bool: def available(self) -> bool:
"""Return True if entity is available.""" """Return True if entity is available."""
return self.device.reachable or False return (
self.device.reachable
or getattr(self.device, self.entity_description.netatmo_name) is not None
)
@callback @callback
def async_update_callback(self) -> None: def async_update_callback(self) -> None:

View File

@ -901,13 +901,15 @@
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'attribution': 'Data provided by Netatmo', 'attribution': 'Data provided by Netatmo',
'friendly_name': 'Bedroom Reachability', 'friendly_name': 'Bedroom Reachability',
'latitude': 13.377726,
'longitude': 52.516263,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.bedroom_reachability', 'entity_id': 'sensor.bedroom_reachability',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'unavailable', 'state': 'False',
}) })
# --- # ---
# name: test_entity[sensor.bedroom_temperature-entry] # name: test_entity[sensor.bedroom_temperature-entry]
@ -1050,13 +1052,15 @@
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'attribution': 'Data provided by Netatmo', 'attribution': 'Data provided by Netatmo',
'friendly_name': 'Bedroom Wi-Fi', 'friendly_name': 'Bedroom Wi-Fi',
'latitude': 13.377726,
'longitude': 52.516263,
}), }),
'context': <ANY>, 'context': <ANY>,
'entity_id': 'sensor.bedroom_wi_fi', 'entity_id': 'sensor.bedroom_wi_fi',
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'unavailable', 'state': 'High',
}) })
# --- # ---
# name: test_entity[sensor.bureau_modulate_battery-entry] # name: test_entity[sensor.bureau_modulate_battery-entry]
@ -6692,7 +6696,7 @@
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'unavailable', 'state': '27',
}) })
# --- # ---
# name: test_entity[sensor.villa_outdoor_humidity-entry] # name: test_entity[sensor.villa_outdoor_humidity-entry]
@ -6791,7 +6795,7 @@
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'unavailable', 'state': 'High',
}) })
# --- # ---
# name: test_entity[sensor.villa_outdoor_reachability-entry] # name: test_entity[sensor.villa_outdoor_reachability-entry]
@ -6838,7 +6842,7 @@
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': 'unavailable', 'state': 'False',
}) })
# --- # ---
# name: test_entity[sensor.villa_outdoor_temperature-entry] # name: test_entity[sensor.villa_outdoor_temperature-entry]