Add LZW36 device schema to zwave_js discovery (#47314)

* Add LZW26 device schema to discovery

Co-authored-by: @kpine

* Update homeassistant/components/zwave_js/discovery.py

Co-authored-by: kpine <keith.pine@gmail.com>

* Add tests

* Fix test

Co-authored-by: kpine <keith.pine@gmail.com>
This commit is contained in:
Chris 2021-03-03 16:32:37 -07:00 committed by GitHub
parent 53e62a897b
commit 6d478804e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 1996 additions and 0 deletions

View file

@ -115,6 +115,20 @@ DISCOVERY_SCHEMAS = [
product_type={0x0038},
primary_value=SWITCH_MULTILEVEL_CURRENT_VALUE_SCHEMA,
),
# Inovelli LZW36 light / fan controller combo using switch multilevel CC
# The fan is endpoint 2, the light is endpoint 1.
ZWaveDiscoverySchema(
platform="fan",
manufacturer_id={0x031E},
product_id={0x0001},
product_type={0x000E},
primary_value=ZWaveValueDiscoverySchema(
command_class={CommandClass.SWITCH_MULTILEVEL},
endpoint={2},
property={"currentValue"},
type={"number"},
),
),
# Fibaro Shutter Fibaro FGS222
ZWaveDiscoverySchema(
platform="cover",

View file

@ -282,6 +282,12 @@ def aeotec_radiator_thermostat_state_fixture():
return json.loads(load_fixture("zwave_js/aeotec_radiator_thermostat_state.json"))
@pytest.fixture(name="inovelli_lzw36_state", scope="session")
def inovelli_lzw36_state_fixture():
"""Load the Inovelli LZW36 node state fixture data."""
return json.loads(load_fixture("zwave_js/inovelli_lzw36_state.json"))
@pytest.fixture(name="client")
def mock_client_fixture(controller_state, version_state):
"""Mock a client."""
@ -512,3 +518,11 @@ def ge_12730_fixture(client, ge_12730_state):
node = Node(client, copy.deepcopy(ge_12730_state))
client.driver.controller.nodes[node.node_id] = node
return node
@pytest.fixture(name="inovelli_lzw36")
def inovelli_lzw36_fixture(client, inovelli_lzw36_state):
"""Mock a Inovelli LZW36 fan controller node."""
node = Node(client, copy.deepcopy(inovelli_lzw36_state))
client.driver.controller.nodes[node.node_id] = node
return node

View file

@ -23,3 +23,15 @@ async def test_ge_12730(hass, client, ge_12730, integration):
state = hass.states.get("fan.in_wall_smart_fan_control")
assert state
async def test_inovelli_lzw36(hass, client, inovelli_lzw36, integration):
"""Test LZW36 Fan Controller multilevel switch endpoint 2 is discovered as a fan."""
node = inovelli_lzw36
assert node.device_class.specific.label == "Unused"
state = hass.states.get("light.family_room_combo")
assert state.state == "off"
state = hass.states.get("fan.family_room_combo_2")
assert state

File diff suppressed because it is too large Load diff