diff --git a/custom_components/hon/button.py b/custom_components/hon/button.py index ce8f9d4..b9063d0 100644 --- a/custom_components/hon/button.py +++ b/custom_components/hon/button.py @@ -69,7 +69,7 @@ class HonButtonEntity(HonEntity, ButtonEntity): """Return True if entity is available.""" return ( super().available - and self._device.get("remoteCtrValid") == "1" + and self._device.get("remoteCtrValid", "1") == "1" and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" ) diff --git a/custom_components/hon/number.py b/custom_components/hon/number.py index 01aaac7..81e8d21 100644 --- a/custom_components/hon/number.py +++ b/custom_components/hon/number.py @@ -243,7 +243,7 @@ class HonNumberEntity(HonEntity, NumberEntity): else: return ( super().available - and self._device.get("remoteCtrValid") == "1" + and self._device.get("remoteCtrValid", "1") == "1" and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" ) diff --git a/custom_components/hon/select.py b/custom_components/hon/select.py index 43b43ed..d769d3b 100644 --- a/custom_components/hon/select.py +++ b/custom_components/hon/select.py @@ -207,7 +207,7 @@ class HonSelectEntity(HonEntity, SelectEntity): else: return ( super().available - and self._device.get("remoteCtrValid") == "1" + and self._device.get("remoteCtrValid", "1") == "1" and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" ) diff --git a/custom_components/hon/switch.py b/custom_components/hon/switch.py index b32ccba..5d58ef8 100644 --- a/custom_components/hon/switch.py +++ b/custom_components/hon/switch.py @@ -434,7 +434,7 @@ class HonSwitchEntity(HonEntity, SwitchEntity): else: return ( super().available - and self._device.get("remoteCtrValid") == "1" + and self._device.get("remoteCtrValid", "1") == "1" and self._device.get("attributes.lastConnEvent.category") != "DISCONNECTED" )