From 54c034185f129ce375148bf2a02ef9cefdf1c016 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 12 Sep 2023 17:13:13 +0200 Subject: [PATCH] Use shorthand attributes in Isy994 (#100209) --- homeassistant/components/isy994/binary_sensor.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/isy994/binary_sensor.py b/homeassistant/components/isy994/binary_sensor.py index 27f1887bd92..7be3b87a0d3 100644 --- a/homeassistant/components/isy994/binary_sensor.py +++ b/homeassistant/components/isy994/binary_sensor.py @@ -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.