mirror of https://github.com/home-assistant/core
Implement available property for Airthings BLE sensors (#96735)
This commit is contained in:
parent
b980ed3eac
commit
4ee9a6f130
|
@ -226,6 +226,14 @@ class AirthingsSensor(
|
|||
model=airthings_device.model,
|
||||
)
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Check if device and sensor is available in data."""
|
||||
return (
|
||||
super().available
|
||||
and self.entity_description.key in self.coordinator.data.sensors
|
||||
)
|
||||
|
||||
@property
|
||||
def native_value(self) -> StateType:
|
||||
"""Return the value reported by the sensor."""
|
||||
|
|
Loading…
Reference in New Issue