mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add device class update to hassio update entities (#54733)
This commit is contained in:
parent
e0a8ec4f62
commit
789e6555cc
@ -1,7 +1,10 @@
|
||||
"""Binary sensor platform for Hass.io addons."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_UPDATE,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
@ -35,6 +38,8 @@ async def async_setup_entry(
|
||||
class HassioAddonBinarySensor(HassioAddonEntity, BinarySensorEntity):
|
||||
"""Binary sensor to track whether an update is available for a Hass.io add-on."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_UPDATE
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if the binary sensor is on."""
|
||||
@ -44,6 +49,8 @@ class HassioAddonBinarySensor(HassioAddonEntity, BinarySensorEntity):
|
||||
class HassioOSBinarySensor(HassioOSEntity, BinarySensorEntity):
|
||||
"""Binary sensor to track whether an update is available for Hass.io OS."""
|
||||
|
||||
_attr_device_class = DEVICE_CLASS_UPDATE
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if the binary sensor is on."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user