mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Add device_class to Stookalert (#34638)
Co-authored-by: Franck Nijhof <git@frenck.dev> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
770b622a6e
commit
7338feb659
@ -13,6 +13,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
SCAN_INTERVAL = timedelta(minutes=60)
|
SCAN_INTERVAL = timedelta(minutes=60)
|
||||||
CONF_PROVINCE = "province"
|
CONF_PROVINCE = "province"
|
||||||
|
DEFAULT_DEVICE_CLASS = "safety"
|
||||||
DEFAULT_NAME = "Stookalert"
|
DEFAULT_NAME = "Stookalert"
|
||||||
ATTRIBUTION = "Data provided by rivm.nl"
|
ATTRIBUTION = "Data provided by rivm.nl"
|
||||||
PROVINCES = [
|
PROVINCES = [
|
||||||
@ -74,6 +75,11 @@ class StookalertBinarySensor(BinarySensorEntity):
|
|||||||
"""Return True if the Alert is active."""
|
"""Return True if the Alert is active."""
|
||||||
return self._api_handler.state == 1
|
return self._api_handler.state == 1
|
||||||
|
|
||||||
|
@property
|
||||||
|
def device_class(self):
|
||||||
|
"""Return the device class of this binary sensor."""
|
||||||
|
return DEFAULT_DEVICE_CLASS
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the data from the Stookalert handler."""
|
"""Update the data from the Stookalert handler."""
|
||||||
self._api_handler.get_alerts()
|
self._api_handler.get_alerts()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user