mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
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,
|
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
|
@property
|
||||||
def native_value(self) -> StateType:
|
def native_value(self) -> StateType:
|
||||||
"""Return the value reported by the sensor."""
|
"""Return the value reported by the sensor."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user