Skip to content

Commit

Permalink
Add zdb5100 light to zwave_js (#97586)
Browse files Browse the repository at this point in the history
* added zdb5100 light

* added light to zdb5100

* Update tests/components/zwave_js/conftest.py

agree

Co-authored-by: Martin Hjelmare <[email protected]>

* Update tests/components/zwave_js/conftest.py

agree

Co-authored-by: Martin Hjelmare <[email protected]>

* Rename logic_group_zdb5100_light_state.json to logic_group_zdb5100_state.json

name change

* Update tests/components/zwave_js/test_light.py

Co-authored-by: Martin Hjelmare <[email protected]>

* Update test_light.py

updated test and state

* Update test_light.py

incorrect endpoint

* changed the state

---------

Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
Roagert and MartinHjelmare authored Sep 9, 2023
1 parent c77eb70 commit 74a7bcc
Show file tree
Hide file tree
Showing 4 changed files with 4,896 additions and 0 deletions.
13 changes: 13 additions & 0 deletions homeassistant/components/zwave_js/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,19 @@ class ZWaveDiscoverySchema:
),
absent_values=[SWITCH_MULTILEVEL_CURRENT_VALUE_SCHEMA],
),
# Logic Group ZDB5100
ZWaveDiscoverySchema(
platform=Platform.LIGHT,
hint="black_is_off",
manufacturer_id={0x0234},
product_id={0x0121},
product_type={0x0003},
primary_value=ZWaveValueDiscoverySchema(
command_class={CommandClass.SWITCH_COLOR},
property={CURRENT_COLOR_PROPERTY},
property_key={None},
),
),
# ====== START OF GENERIC MAPPING SCHEMAS =======
# locks
# Door Lock CC
Expand Down
14 changes: 14 additions & 0 deletions tests/components/zwave_js/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,12 @@ def nice_ibt4zwave_state_fixture():
return json.loads(load_fixture("zwave_js/cover_nice_ibt4zwave_state.json"))


@pytest.fixture(name="logic_group_zdb5100_state", scope="session")
def logic_group_zdb5100_state_fixture():
"""Load the Logic Group ZDB5100 node state fixture data."""
return json.loads(load_fixture("zwave_js/logic_group_zdb5100_state.json"))


# model fixtures


Expand Down Expand Up @@ -1262,3 +1268,11 @@ def nice_ibt4zwave_fixture(client, nice_ibt4zwave_state):
node = Node(client, copy.deepcopy(nice_ibt4zwave_state))
client.driver.controller.nodes[node.node_id] = node
return node


@pytest.fixture(name="logic_group_zdb5100")
def logic_group_zdb5100_fixture(client, logic_group_zdb5100_state):
"""Mock a ZDB5100 light node."""
node = Node(client, copy.deepcopy(logic_group_zdb5100_state))
client.driver.controller.nodes[node.node_id] = node
return node
Loading

0 comments on commit 74a7bcc

Please sign in to comment.