mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
WAQI add unique ID and availability (#27086)
* WAQI add unique ID and availability * Review comments * Fix unique ID * Fix unique ID
This commit is contained in:
parent
98eaecf61d
commit
4b4a290f71
@ -128,6 +128,16 @@ class WaqiSensor(Entity):
|
|||||||
return self._data.get("aqi")
|
return self._data.get("aqi")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def available(self):
|
||||||
|
"""Return sensor availability."""
|
||||||
|
return self._data is not None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unique_id(self):
|
||||||
|
"""Return unique ID."""
|
||||||
|
return self.uid
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
"""Return the unit of measurement of this entity, if any."""
|
"""Return the unit of measurement of this entity, if any."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user