From 3d8f5c48bb1bca905b8f868d0da36261a135e225 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Aug 2026 06:37:16 +0000 Subject: [PATCH 1/2] Initial plan From 986bf89f76a412a568ade768c7da7a42ec2fa2a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 12 Aug 2026 06:40:02 +0000 Subject: [PATCH 2/2] Fix Fox SOH sensor to avoid low-battery device class Co-authored-by: springfall2008 <48591903+springfall2008@users.noreply.github.com> --- apps/predbat/fox.py | 2 +- apps/predbat/tests/test_fox_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/predbat/fox.py b/apps/predbat/fox.py index 6767ead02..1657e07c1 100644 --- a/apps/predbat/fox.py +++ b/apps/predbat/fox.py @@ -1792,7 +1792,7 @@ async def publish_data(self): self.dashboard_item( entity_name_sensor + "_" + sn.lower() + "_battery_soh", state=soh_fraction, - attributes={"friendly_name": f"Fox {sn} Battery State of Health", "unit_of_measurement": "*", "device_class": "battery", "state_class": "measurement", "icon": "mdi:battery-heart"}, + attributes={"friendly_name": f"Fox {sn} Battery State of Health", "unit_of_measurement": "*", "state_class": "measurement", "icon": "mdi:battery-heart"}, app="fox", ) diff --git a/apps/predbat/tests/test_fox_api.py b/apps/predbat/tests/test_fox_api.py index e5245cce8..b98bec5d6 100644 --- a/apps/predbat/tests/test_fox_api.py +++ b/apps/predbat/tests/test_fox_api.py @@ -5538,7 +5538,7 @@ def test_publish_data_battery_soh(my_predbat): assert soh_entity in fox.dashboard_items, f"battery_soh entity not found in {list(fox.dashboard_items.keys())}" assert fox.dashboard_items[soh_entity]["state"] == 0.95, f"Expected 0.95, got {fox.dashboard_items[soh_entity]['state']}" assert fox.dashboard_items[soh_entity]["attributes"]["unit_of_measurement"] == "*" - assert fox.dashboard_items[soh_entity]["attributes"]["device_class"] == "battery" + assert "device_class" not in fox.dashboard_items[soh_entity]["attributes"] assert fox.dashboard_items[soh_entity]["attributes"]["state_class"] == "measurement" assert fox.dashboard_items[soh_entity]["attributes"]["icon"] == "mdi:battery-heart"