diff --git a/custom_components/bhyve/sensor.py b/custom_components/bhyve/sensor.py index 2b29162..45b3082 100644 --- a/custom_components/bhyve/sensor.py +++ b/custom_components/bhyve/sensor.py @@ -1,4 +1,5 @@ """Support for Orbit BHyve sensors.""" + import logging from datetime import timedelta @@ -173,7 +174,7 @@ def parse_battery_level(battery_data): float: The battery level as a percentage. """ battery_level = battery_data.get("percent", 0) - if "mv" in battery_data: + if "mv" in battery_data and "percent" not in battery_data: battery_level = min(battery_data.get("mv", 0) / 3000 * 100, 100) return battery_level