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"