mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Implement available property for Airthings BLE sensors (#96735)
This commit is contained in:
@@ -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."""
|
||||
|
Reference in New Issue
Block a user