@@ -590,9 +590,16 @@ async def call_get_location_query(self, location_hilo_id: str) -> None:
590590 return
591591
592592 if "data" in response_json :
593- devices = response_json ["data" ].get ("getLocation" , {}).get ("devices" , [])
594- gateways = [d for d in devices if d .get ("deviceType" ) in ("Gateway" , "Hub" )]
595- LOG .debug ("Gateway devices in getLocation response: %s" , json .dumps (gateways , indent = 2 ))
593+ devices = (
594+ response_json ["data" ].get ("getLocation" , {}).get ("devices" , [])
595+ )
596+ gateways = [
597+ d for d in devices if d .get ("deviceType" ) in ("Gateway" , "Hub" )
598+ ]
599+ LOG .debug (
600+ "Gateway devices in getLocation response: %s" ,
601+ json .dumps (gateways , indent = 2 ),
602+ )
596603 self ._handle_query_result (response_json ["data" ])
597604
598605 async def subscribe_to_device_updated (
@@ -828,15 +835,16 @@ def _build_gateway_dict(self, raw_device: Dict[str, Any]) -> Dict[str, Any]:
828835 "supportedAttributes" : "zigBeePairingActivated, zigBeeChannel, firmwareVersion, onlineStatus, lastStatusTime, disconnected" ,
829836 "settableAttributes" : "" ,
830837 "Disconnected" : {"value" : connection_status != "CONNECTED" },
831- "zigBeePairingActivated" : {"value" : bool (raw_device .get ("zigBeePairingModeEnhanced" ))},
838+ "zigBeePairingActivated" : {
839+ "value" : bool (raw_device .get ("zigBeePairingModeEnhanced" ))
840+ },
832841 "zigBeeChannel" : {"value" : raw_device .get ("zigBeeChannel" )},
833842 "firmwareVersion" : {"value" : raw_device .get ("controllerSoftwareVersion" )},
834843 "onlineStatus" : {"value" : connection_status },
835844 "lastStatusTime" : {"value" : raw_device .get ("lastConnectionTime" )},
836845 "disconnected" : {"value" : connection_status != "CONNECTED" },
837846 }
838847
839-
840848 def _handle_device_subscription_result (self , result : Dict [str , Any ]) -> str :
841849 device_value : Dict [str , Any ] = result ["onAnyDeviceUpdated" ]["device" ]
842850 attributes = self .mapper .map_device_subscription_values (device_value )
0 commit comments