From e5c56629e25d32db2032f5b22e60813cf4ba9938 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Thu, 8 May 2025 11:59:20 +0200 Subject: [PATCH] Fix Z-Wave reset accumulated values button entity category (#144459) --- homeassistant/components/zwave_js/discovery.py | 2 +- tests/components/zwave_js/test_discovery.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zwave_js/discovery.py b/homeassistant/components/zwave_js/discovery.py index 5c79c668afc..b46735e4040 100644 --- a/homeassistant/components/zwave_js/discovery.py +++ b/homeassistant/components/zwave_js/discovery.py @@ -1204,7 +1204,7 @@ DISCOVERY_SCHEMAS = [ property={RESET_METER_PROPERTY}, type={ValueType.BOOLEAN}, ), - entity_category=EntityCategory.DIAGNOSTIC, + entity_category=EntityCategory.CONFIG, ), ZWaveDiscoverySchema( platform=Platform.BINARY_SENSOR, diff --git a/tests/components/zwave_js/test_discovery.py b/tests/components/zwave_js/test_discovery.py index 0be0cca78c8..7ef5f0e480f 100644 --- a/tests/components/zwave_js/test_discovery.py +++ b/tests/components/zwave_js/test_discovery.py @@ -431,10 +431,11 @@ async def test_rediscovery( async def test_aeotec_smart_switch_7( hass: HomeAssistant, + entity_registry: er.EntityRegistry, aeotec_smart_switch_7: Node, integration: MockConfigEntry, ) -> None: - """Test that Smart Switch 7 has a light and a switch entity.""" + """Test Smart Switch 7 discovery.""" state = hass.states.get("light.smart_switch_7") assert state assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [ @@ -443,3 +444,9 @@ async def test_aeotec_smart_switch_7( state = hass.states.get("switch.smart_switch_7") assert state + + state = hass.states.get("button.smart_switch_7_reset_accumulated_values") + assert state + entity_entry = entity_registry.async_get(state.entity_id) + assert entity_entry + assert entity_entry.entity_category is EntityCategory.CONFIG