From b9841bf98e4f0162b2a1472e0b2f64ebc0de6654 Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Sun, 1 Nov 2026 13:27:35 -0500 Subject: [PATCH] Add DISCONNECTED state Hilo sends a string --- pyhilo/device/graphql_value_mapper.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pyhilo/device/graphql_value_mapper.py b/pyhilo/device/graphql_value_mapper.py index 9954bbe..08e2caf 100644 --- a/pyhilo/device/graphql_value_mapper.py +++ b/pyhilo/device/graphql_value_mapper.py @@ -84,7 +84,9 @@ def _build_smart_meter(self, device: Dict[str, Any]) -> list[Dict[str, Any]]: ) attributes.append( self.build_attribute( - device["hiloId"], "Disconnected", device["connectionStatus"] == 2 + device["hiloId"], + "Disconnected", + device["connectionStatus"] == "DISCONNECTED", ), ) if device.get("power") is not None: @@ -105,7 +107,9 @@ def _build_gateway(self, device: Dict[str, Any]) -> list[Dict[str, Any]]: ) attributes.append( self.build_attribute( - device["hiloId"], "Disconnected", device["connectionStatus"] == 2 + device["hiloId"], + "Disconnected", + device["connectionStatus"] == "DISCONNECTED", ) ) # Offline attributes.append( @@ -451,7 +455,7 @@ def _map_basic_device(self, device: Dict[str, Any]) -> list[Dict[str, Any]]: self.build_attribute( device["hiloId"], "Disconnected", - device["connectionStatus"] == "Disconnected", + device["connectionStatus"] == "DISCONNECTED", ), ]