bhyve-home-assistant icon indicating copy to clipboard operation
bhyve-home-assistant copied to clipboard

Update for sensor.XXXX_smart_hose_tap_timer_battery_level fails

Open dinan5 opened this issue 6 months ago • 2 comments

Describe the bug Multiple times per day I get the following error message

Update for sensor.XXXX_smart_hose_tap_timer_battery_level fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update await self.async_update() File "/config/custom_components/bhyve/sensor.py", line 155, in async_update await super().async_update() File "/config/custom_components/bhyve/init.py", line 247, in async_update self._on_ws_data(ws_event) File "/config/custom_components/bhyve/sensor.py", line 148, in _on_ws_data battery_level = self.parse_battery_level(event) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bhyve/sensor.py", line 175, in parse_battery_level battery_level = battery_data.get("percent", 0) ^^^^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'get'

Expected behaviour No error to occur

BHyve devices 2 devices - Smart Hose Tap, Orbit Sprinkler Controller

Device Diagnostics

dinan5 avatar Dec 15 '23 19:12 dinan5