kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
179 stars 35 forks source link

Get RSSI error #105

Open leroyloren opened 2 years ago

leroyloren commented 2 years ago

A flood of error logs at frequent intervals.

2022-09-10 20:21:14.068 DEBUG (MainThread) [custom_components.nuki_ng.nuki] bridge_check_callback: {'callbacks': [{'id': 0, 'url': 'http://10.7.1.253:8123/api/webhook/nuki_ng_bridge_hook_8aeeba69c7a46693565e2359ff9c55b6'}]}, http://10.7.1.253:8123/api/webhook/nuki_ng_bridge_hook_8aeeba69c7a46693565e2359ff9c55b6 2022-09-10 20:21:14.069 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Callback is set 2022-09-10 20:21:14.252 DEBUG (MainThread) [custom_components.nuki_ng.nuki] _update: {"devices": {"xxx": {"deviceType": 0, "nukiId": xxx, "name": "Z\u00e1mek", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "batteryCharging": false, "batteryChargeState": 58, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2022-09-10T18:10:09+00:00"}, "bridge_info": {"deviceType": 0, "nukiId": xxx, "name": "Nuki_xxx", "rssi": -71, "paired": true}}}, "bridge_info": {"bridgeType": 1, "ids": {"hardwareId": xxx, "serverId": 273616912}, "versions": {"firmwareVersion": "1.23.0", "wifiFirmwareVersion": "1.2.0"}, "uptime": 3006, "currentTime": "2022-09-10T18:21:13+00:00", "serverConnected": true, "scanResults": [{"deviceType": 0, "nukiId": xxx, "name": "Nuki_xxx", "rssi": -71, "paired": true}], "callbacks_list": [{"id": 0, "url": "http://10.7.1.253:8123/api/webhook/nuki_ng_bridge_hook_8aeeba69c7a46693565e2359ff9c55b6"}]}} 2022-09-10 20:21:14.252 DEBUG (MainThread) [custom_components.nuki_ng.nuki] Finished fetching nuki_ng data in 0.251 seconds (success: True) 2022-09-10 20:21:15.535 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547323128000] Received {'type': 'system_log/list', 'id': 41} 2022-09-10 20:21:15.538 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [547323128000] Sending {"id":41,"type":"result","success":true,"result":[{"name":"homeassistant","message":["Error doing job: Task exception was never retrieved"],"level":"ERROR","source":["custom_components/nuki_ng/sensor.py",94],"timestamp":1662833924.2391815,"exception":"Traceback (most recent call last):\n File \"/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py\", line 151, in _handle_refresh_interval\n await self._async_refresh(log_failures=True, scheduled=True)\n File \"/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py\", line 283, in _async_refresh\n self.async_update_listeners()\n File \"/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py\", line 110, in async_update_listeners\n update_callback()\n File \"/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py\", line 348, in _handle_coordinator_update\n self.async_write_ha_state()\n File \"/usr/src/homeassistant/homeassistant/helpers/entity.py\", line 533, in async_write_ha_state\n self._async_write_ha_state()\n File \"/usr/src/homeassistant/homeassistant/helpers/entity.py\", line 571, in _async_write_ha_state\n state = self._stringify_state(available)\n File \"/usr/src/homeassistant/homeassistant/helpers/entity.py\", line 539, in _stringify_state\n if (state := self.state) is None:\n File \"/config/custom_components/nuki_ng/sensor.py\", line 98, in state\n return self.native_value\n File \"/config/custom_components/nuki_ng/sensor.py\", line 94, in native_value\n return self.data.get(\"bridge_info\", {}).get(\"rssi\")\nAttributeError: 'NoneType' object has no attribute 'get'\n","count":2,"first_occurred":1662833834.2729838}]}

kvj commented 2 years ago

I will take a look