mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add discovery for Z-Wave Meter Reset (#119968)
This commit is contained in:
parent
5e375dbf38
commit
a1884ed821
@ -27,7 +27,10 @@ from zwave_js_server.const.command_class.lock import (
|
|||||||
DOOR_STATUS_PROPERTY,
|
DOOR_STATUS_PROPERTY,
|
||||||
LOCKED_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.protection import LOCAL_PROPERTY, RF_PROPERTY
|
||||||
from zwave_js_server.const.command_class.sound_switch import (
|
from zwave_js_server.const.command_class.sound_switch import (
|
||||||
DEFAULT_TONE_ID_PROPERTY,
|
DEFAULT_TONE_ID_PROPERTY,
|
||||||
@ -1180,6 +1183,18 @@ DISCOVERY_SCHEMAS = [
|
|||||||
stateful=False,
|
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
|
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:
|
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."""
|
"""Test that an iBlinds v2.0 multilevel switch value is discovered as a cover."""
|
||||||
node = iblinds_v2
|
node = iblinds_v2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user