diff --git a/custom_components/hon/button.py b/custom_components/hon/button.py index f5f3d28..ce0f548 100644 --- a/custom_components/hon/button.py +++ b/custom_components/hon/button.py @@ -82,7 +82,7 @@ class HonButtonEntity(HonEntity, ButtonEntity): return ( super().available and int(self._device.get("remoteCtrValid", "1")) == 1 - and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" + and self._device.connection ) diff --git a/custom_components/hon/lock.py b/custom_components/hon/lock.py index 510641c..63304c1 100644 --- a/custom_components/hon/lock.py +++ b/custom_components/hon/lock.py @@ -76,7 +76,7 @@ class HonLockEntity(HonEntity, LockEntity): return ( super().available and int(self._device.get("remoteCtrValid", 1)) == 1 - and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" + and self._device.connection ) @callback diff --git a/custom_components/hon/manifest.json b/custom_components/hon/manifest.json index 49abb37..637fd88 100644 --- a/custom_components/hon/manifest.json +++ b/custom_components/hon/manifest.json @@ -9,7 +9,7 @@ "iot_class": "cloud_push", "issue_tracker": "https://github.com/Andre0512/hon/issues", "requirements": [ - "pyhOn==0.17.2" + "pyhOn==0.17.3" ], - "version": "0.14.0-beta.4" + "version": "0.14.0-beta.5" } diff --git a/custom_components/hon/number.py b/custom_components/hon/number.py index 8cf8a1e..fc6e88f 100644 --- a/custom_components/hon/number.py +++ b/custom_components/hon/number.py @@ -276,7 +276,7 @@ class HonNumberEntity(HonEntity, NumberEntity): return ( super().available and int(self._device.get("remoteCtrValid", 1)) == 1 - and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" + and self._device.connection ) diff --git a/custom_components/hon/select.py b/custom_components/hon/select.py index 1eb620e..7bd9440 100644 --- a/custom_components/hon/select.py +++ b/custom_components/hon/select.py @@ -325,7 +325,7 @@ class HonSelectEntity(HonEntity, SelectEntity): return ( super().available and int(self._device.get("remoteCtrValid", 1)) == 1 - and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" + and self._device.connection ) @callback diff --git a/custom_components/hon/switch.py b/custom_components/hon/switch.py index 36d283e..063e6db 100644 --- a/custom_components/hon/switch.py +++ b/custom_components/hon/switch.py @@ -507,7 +507,7 @@ class HonControlSwitchEntity(HonEntity, SwitchEntity): return ( super().available and int(self._device.get("remoteCtrValid", 1)) == 1 - and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" + and self._device.connection ) @property diff --git a/requirements.txt b/requirements.txt index 11d498a..fb9018e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -pyhOn==0.17.2 +pyhOn==0.17.3