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
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
SCAN_INTERVAL = timedelta(minutes=60)
|
||||
CONF_PROVINCE = "province"
|
||||
DEFAULT_DEVICE_CLASS = "safety"
|
||||
DEFAULT_NAME = "Stookalert"
|
||||
ATTRIBUTION = "Data provided by rivm.nl"
|
||||
PROVINCES = [
|
||||
|
@ -74,6 +75,11 @@ class StookalertBinarySensor(BinarySensorEntity):
|
|||
"""Return True if the Alert is active."""
|
||||
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):
|
||||
"""Update the data from the Stookalert handler."""
|
||||
self._api_handler.get_alerts()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue