Use shorthand attributes in Isy994 (#100209)
parent
6e6680dc4d
commit
54c034185f
|
@ -249,7 +249,8 @@ class ISYBinarySensorEntity(ISYNodeEntity, BinarySensorEntity):
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the ISY binary sensor device."""
|
"""Initialize the ISY binary sensor device."""
|
||||||
super().__init__(node, device_info=device_info)
|
super().__init__(node, device_info=device_info)
|
||||||
self._device_class = force_device_class
|
# This was discovered by parsing the device type code during init
|
||||||
|
self._attr_device_class = force_device_class
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool | None:
|
def is_on(self) -> bool | None:
|
||||||
|
@ -258,14 +259,6 @@ class ISYBinarySensorEntity(ISYNodeEntity, BinarySensorEntity):
|
||||||
return None
|
return None
|
||||||
return bool(self._node.status)
|
return bool(self._node.status)
|
||||||
|
|
||||||
@property
|
|
||||||
def device_class(self) -> BinarySensorDeviceClass | None:
|
|
||||||
"""Return the class of this device.
|
|
||||||
|
|
||||||
This was discovered by parsing the device type code during init
|
|
||||||
"""
|
|
||||||
return self._device_class
|
|
||||||
|
|
||||||
|
|
||||||
class ISYInsteonBinarySensorEntity(ISYBinarySensorEntity):
|
class ISYInsteonBinarySensorEntity(ISYBinarySensorEntity):
|
||||||
"""Representation of an ISY Insteon binary sensor device.
|
"""Representation of an ISY Insteon binary sensor device.
|
||||||
|
|
Loading…
Reference in New Issue