Use shorthand attributes in Isy994 (#100209)

pull/100217/head
Joost Lekkerkerker 2023-09-12 17:13:13 +02:00 committed by GitHub
parent 6e6680dc4d
commit 54c034185f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -249,7 +249,8 @@ class ISYBinarySensorEntity(ISYNodeEntity, BinarySensorEntity):
) -> None:
"""Initialize the ISY binary sensor device."""
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
def is_on(self) -> bool | None:
@ -258,14 +259,6 @@ class ISYBinarySensorEntity(ISYNodeEntity, BinarySensorEntity):
return None
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):
"""Representation of an ISY Insteon binary sensor device.