From b0b3c046f9425c4b9cf01dbc9d6ef63c936b8162 Mon Sep 17 00:00:00 2001 From: Seb Ruiz Date: Wed, 24 Apr 2024 09:59:17 +1000 Subject: [PATCH] Fix #236: Fix warning when updating battery from websocket event (#239) --- custom_components/bhyve/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/bhyve/sensor.py b/custom_components/bhyve/sensor.py index f0bb8f0..45f238f 100644 --- a/custom_components/bhyve/sensor.py +++ b/custom_components/bhyve/sensor.py @@ -146,7 +146,7 @@ def _on_ws_data(self, data): # event = data.get("event") if event in (EVENT_BATTERY_STATUS): - battery_level = self.parse_battery_level(event) + battery_level = self.parse_battery_level(data) self._state = battery_level self._attrs[ATTR_BATTERY_LEVEL] = battery_level