Add discovery for Z-Wave Meter Reset (#119968)
This commit is contained in:
parent
5e375dbf38
commit
a1884ed821
2 changed files with 24 additions and 1 deletions
|
@ -27,7 +27,10 @@ from zwave_js_server.const.command_class.lock import (
|
|||
DOOR_STATUS_PROPERTY,
|
||||
LOCKED_PROPERTY,
|
||||
)
|
||||
from zwave_js_server.const.command_class.meter import VALUE_PROPERTY
|
||||
from zwave_js_server.const.command_class.meter import (
|
||||
RESET_PROPERTY as RESET_METER_PROPERTY,
|
||||
VALUE_PROPERTY,
|
||||
)
|
||||
from zwave_js_server.const.command_class.protection import LOCAL_PROPERTY, RF_PROPERTY
|
||||
from zwave_js_server.const.command_class.sound_switch import (
|
||||
DEFAULT_TONE_ID_PROPERTY,
|
||||
|
@ -1180,6 +1183,18 @@ DISCOVERY_SCHEMAS = [
|
|||
stateful=False,
|
||||
),
|
||||
),
|
||||
# button
|
||||
# Meter CC idle
|
||||
ZWaveDiscoverySchema(
|
||||
platform=Platform.BUTTON,
|
||||
hint="meter reset",
|
||||
primary_value=ZWaveValueDiscoverySchema(
|
||||
command_class={CommandClass.METER},
|
||||
property={RESET_METER_PROPERTY},
|
||||
type={ValueType.BOOLEAN},
|
||||
),
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -29,6 +29,14 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
|
||||
|
||||
async def test_aeon_smart_switch_6_state(
|
||||
hass: HomeAssistant, client, aeon_smart_switch_6, integration
|
||||
) -> None:
|
||||
"""Test that Smart Switch 6 has a meter reset button."""
|
||||
state = hass.states.get("button.smart_switch_6_reset_accumulated_values")
|
||||
assert state
|
||||
|
||||
|
||||
async def test_iblinds_v2(hass: HomeAssistant, client, iblinds_v2, integration) -> None:
|
||||
"""Test that an iBlinds v2.0 multilevel switch value is discovered as a cover."""
|
||||
node = iblinds_v2
|
||||
|
|
Loading…
Add table
Reference in a new issue