Fix Netatmo indoor sensor (#116342)

* Debug netatmo indoor sensor

* Debug netatmo indoor sensor

* Fix
pull/116346/head
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
def available(self) -> bool:
"""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
def async_update_callback(self) -> None:

View File

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