Add zwave_js light platform tests (#45107)
* Add bulb 6 multi color device state fixture * Add light test foundation * Add no cover comment for todo code * Update hs_color * Test turn on light * Test light turn off * Fix brightness comparison * Test setting same brightness * Test setting same rgb color * Test color temp update * Test setting same color temp * Add entity module to coverage calculation * Fix typingpull/45114/head
parent
de8f273bd0
commit
79d37fdf12
|
@ -1,6 +1,6 @@
|
||||||
"""Support for Z-Wave lights."""
|
"""Support for Z-Wave lights."""
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable, List, Optional
|
from typing import Any, Callable, Optional, Tuple
|
||||||
|
|
||||||
from zwave_js_server.client import Client as ZwaveClient
|
from zwave_js_server.client import Client as ZwaveClient
|
||||||
from zwave_js_server.const import CommandClass
|
from zwave_js_server.const import CommandClass
|
||||||
|
@ -68,7 +68,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
self._supports_color = False
|
self._supports_color = False
|
||||||
self._supports_white_value = False
|
self._supports_white_value = False
|
||||||
self._supports_color_temp = False
|
self._supports_color_temp = False
|
||||||
self._hs_color: Optional[List[float]] = None
|
self._hs_color: Optional[Tuple[float, float]] = None
|
||||||
self._white_value: Optional[int] = None
|
self._white_value: Optional[int] = None
|
||||||
self._color_temp: Optional[int] = None
|
self._color_temp: Optional[int] = None
|
||||||
self._min_mireds = 153 # 6500K as a safe default
|
self._min_mireds = 153 # 6500K as a safe default
|
||||||
|
@ -111,7 +111,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
return self.brightness > 0
|
return self.brightness > 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hs_color(self) -> Optional[List[float]]:
|
def hs_color(self) -> Optional[Tuple[float, float]]:
|
||||||
"""Return the hs color."""
|
"""Return the hs color."""
|
||||||
return self._hs_color
|
return self._hs_color
|
||||||
|
|
||||||
|
@ -218,22 +218,23 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
self, brightness: Optional[int], transition: Optional[int] = None
|
self, brightness: Optional[int], transition: Optional[int] = None
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set new brightness to light."""
|
"""Set new brightness to light."""
|
||||||
if self.info.primary_value.value == brightness:
|
|
||||||
# no point in setting same brightness
|
|
||||||
return
|
|
||||||
if brightness is None and self.info.primary_value.value:
|
if brightness is None and self.info.primary_value.value:
|
||||||
# there is no point in setting default brightness when light is already on
|
# there is no point in setting default brightness when light is already on
|
||||||
return
|
return
|
||||||
if brightness is None:
|
if brightness is None:
|
||||||
# Level 255 means to set it to previous value.
|
# Level 255 means to set it to previous value.
|
||||||
brightness = 255
|
zwave_brightness = 255
|
||||||
else:
|
else:
|
||||||
# Zwave multilevel switches use a range of [0, 99] to control brightness.
|
# Zwave multilevel switches use a range of [0, 99] to control brightness.
|
||||||
brightness = byte_to_zwave_brightness(brightness)
|
zwave_brightness = byte_to_zwave_brightness(brightness)
|
||||||
|
|
||||||
|
if self.info.primary_value.value == zwave_brightness:
|
||||||
|
# no point in setting same brightness
|
||||||
|
return
|
||||||
# set transition value before seinding new brightness
|
# set transition value before seinding new brightness
|
||||||
await self._async_set_transition_duration(transition)
|
await self._async_set_transition_duration(transition)
|
||||||
# setting a value requires setting targetValue
|
# setting a value requires setting targetValue
|
||||||
await self.info.node.async_set_value(self._target_value, brightness)
|
await self.info.node.async_set_value(self._target_value, zwave_brightness)
|
||||||
|
|
||||||
async def _async_set_transition_duration(
|
async def _async_set_transition_duration(
|
||||||
self, duration: Optional[int] = None
|
self, duration: Optional[int] = None
|
||||||
|
@ -249,7 +250,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
if duration is None: # type: ignore
|
if duration is None: # type: ignore
|
||||||
# no transition specified by user, use defaults
|
# no transition specified by user, use defaults
|
||||||
duration = 7621 # anything over 7620 uses the factory default
|
duration = 7621 # anything over 7620 uses the factory default
|
||||||
else:
|
else: # pragma: no cover
|
||||||
# transition specified by user
|
# transition specified by user
|
||||||
transition = duration
|
transition = duration
|
||||||
if transition <= 127:
|
if transition <= 127:
|
||||||
|
@ -265,7 +266,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
|
|
||||||
# only send value if it differs from current
|
# only send value if it differs from current
|
||||||
# this prevents sending a command for nothing
|
# this prevents sending a command for nothing
|
||||||
if self._dimming_duration.value != duration:
|
if self._dimming_duration.value != duration: # pragma: no cover
|
||||||
await self.info.node.async_set_value(self._dimming_duration, duration)
|
await self.info.node.async_set_value(self._dimming_duration, duration)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -290,7 +291,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
and green_val.value is not None
|
and green_val.value is not None
|
||||||
and blue_val.value is not None
|
and blue_val.value is not None
|
||||||
):
|
):
|
||||||
self._hs = color_util.color_RGB_to_hs(
|
self._hs_color = color_util.color_RGB_to_hs(
|
||||||
red_val.value, green_val.value, blue_val.value
|
red_val.value, green_val.value, blue_val.value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -320,3 +321,4 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||||
elif ww_val or cw_val:
|
elif ww_val or cw_val:
|
||||||
# only one white channel
|
# only one white channel
|
||||||
self._supports_white_value = True
|
self._supports_white_value = True
|
||||||
|
# FIXME: Update self._white_value
|
||||||
|
|
|
@ -37,6 +37,12 @@ def binary_switch_state_fixture():
|
||||||
return json.loads(load_fixture("zwave_js/hank_binary_switch_state.json"))
|
return json.loads(load_fixture("zwave_js/hank_binary_switch_state.json"))
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="bulb_6_multi_color_state", scope="session")
|
||||||
|
def bulb_6_multi_color_state_fixture():
|
||||||
|
"""Load the bulb 6 multi-color node state fixture data."""
|
||||||
|
return json.loads(load_fixture("zwave_js/bulb_6_multi_color_state.json"))
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="client")
|
@pytest.fixture(name="client")
|
||||||
def mock_client_fixture(controller_state):
|
def mock_client_fixture(controller_state):
|
||||||
"""Mock a client."""
|
"""Mock a client."""
|
||||||
|
@ -64,6 +70,14 @@ def hank_binary_switch_fixture(client, hank_binary_switch_state):
|
||||||
return node
|
return node
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(name="bulb_6_multi_color")
|
||||||
|
def bulb_6_multi_color_fixture(client, bulb_6_multi_color_state):
|
||||||
|
"""Mock a bulb 6 multi-color node."""
|
||||||
|
node = Node(client, bulb_6_multi_color_state)
|
||||||
|
client.driver.controller.nodes[node.node_id] = node
|
||||||
|
return node
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="integration")
|
@pytest.fixture(name="integration")
|
||||||
async def integration_fixture(hass, client):
|
async def integration_fixture(hass, client):
|
||||||
"""Set up the zwave_js integration."""
|
"""Set up the zwave_js integration."""
|
||||||
|
|
|
@ -0,0 +1,377 @@
|
||||||
|
"""Test the Z-Wave JS light platform."""
|
||||||
|
from copy import deepcopy
|
||||||
|
|
||||||
|
from zwave_js_server.event import Event
|
||||||
|
|
||||||
|
from homeassistant.components.light import (
|
||||||
|
ATTR_BRIGHTNESS,
|
||||||
|
ATTR_COLOR_TEMP,
|
||||||
|
ATTR_MAX_MIREDS,
|
||||||
|
ATTR_MIN_MIREDS,
|
||||||
|
ATTR_RGB_COLOR,
|
||||||
|
)
|
||||||
|
from homeassistant.const import ATTR_SUPPORTED_FEATURES, STATE_OFF, STATE_ON
|
||||||
|
|
||||||
|
BULB_6_MULTI_COLOR_LIGHT_ENTITY = "light.bulb_6_multi_color_current_value"
|
||||||
|
|
||||||
|
|
||||||
|
async def test_light(hass, client, bulb_6_multi_color, integration):
|
||||||
|
"""Test the light entity."""
|
||||||
|
node = bulb_6_multi_color
|
||||||
|
state = hass.states.get(BULB_6_MULTI_COLOR_LIGHT_ENTITY)
|
||||||
|
|
||||||
|
assert state
|
||||||
|
assert state.state == STATE_OFF
|
||||||
|
assert state.attributes[ATTR_MIN_MIREDS] == 153
|
||||||
|
assert state.attributes[ATTR_MAX_MIREDS] == 370
|
||||||
|
assert state.attributes[ATTR_SUPPORTED_FEATURES] == 51
|
||||||
|
|
||||||
|
# Test turning on
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 1
|
||||||
|
args = client.async_send_json_message.call_args[0][0]
|
||||||
|
assert args["command"] == "node.set_value"
|
||||||
|
assert args["nodeId"] == 39
|
||||||
|
assert args["valueId"] == {
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetValue",
|
||||||
|
"propertyName": "targetValue",
|
||||||
|
"metadata": {
|
||||||
|
"label": "Target value",
|
||||||
|
"max": 99,
|
||||||
|
"min": 0,
|
||||||
|
"type": "number",
|
||||||
|
"readable": True,
|
||||||
|
"writeable": True,
|
||||||
|
"label": "Target value",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
assert args["value"] == 255
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test brightness update from value updated event
|
||||||
|
event = Event(
|
||||||
|
type="value updated",
|
||||||
|
data={
|
||||||
|
"source": "node",
|
||||||
|
"event": "value updated",
|
||||||
|
"nodeId": 39,
|
||||||
|
"args": {
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentValue",
|
||||||
|
"newValue": 99,
|
||||||
|
"prevValue": 0,
|
||||||
|
"propertyName": "currentValue",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
node.receive_event(event)
|
||||||
|
|
||||||
|
state = hass.states.get(BULB_6_MULTI_COLOR_LIGHT_ENTITY)
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
assert state.attributes[ATTR_BRIGHTNESS] == 255
|
||||||
|
assert state.attributes[ATTR_COLOR_TEMP] == 370
|
||||||
|
|
||||||
|
# Test turning on with same brightness
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_BRIGHTNESS: 255},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 0
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test turning on with brightness
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_BRIGHTNESS: 129},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 1
|
||||||
|
args = client.async_send_json_message.call_args[0][0]
|
||||||
|
assert args["command"] == "node.set_value"
|
||||||
|
assert args["nodeId"] == 39
|
||||||
|
assert args["valueId"] == {
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetValue",
|
||||||
|
"propertyName": "targetValue",
|
||||||
|
"metadata": {
|
||||||
|
"label": "Target value",
|
||||||
|
"max": 99,
|
||||||
|
"min": 0,
|
||||||
|
"type": "number",
|
||||||
|
"readable": True,
|
||||||
|
"writeable": True,
|
||||||
|
"label": "Target value",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
assert args["value"] == 50
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test turning on with rgb color
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_RGB_COLOR: (255, 76, 255)},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 4
|
||||||
|
warm_args = client.async_send_json_message.call_args_list[0][0][0] # warm white 0
|
||||||
|
assert warm_args["command"] == "node.set_value"
|
||||||
|
assert warm_args["nodeId"] == 39
|
||||||
|
assert warm_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert warm_args["valueId"]["commandClass"] == 51
|
||||||
|
assert warm_args["valueId"]["endpoint"] == 0
|
||||||
|
assert warm_args["valueId"]["metadata"]["label"] == "Target value (Warm White)"
|
||||||
|
assert warm_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert warm_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert warm_args["value"] == 0
|
||||||
|
red_args = client.async_send_json_message.call_args_list[1][0][0] # red 255
|
||||||
|
assert red_args["command"] == "node.set_value"
|
||||||
|
assert red_args["nodeId"] == 39
|
||||||
|
assert red_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert red_args["valueId"]["commandClass"] == 51
|
||||||
|
assert red_args["valueId"]["endpoint"] == 0
|
||||||
|
assert red_args["valueId"]["metadata"]["label"] == "Target value (Red)"
|
||||||
|
assert red_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert red_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert red_args["value"] == 255
|
||||||
|
green_args = client.async_send_json_message.call_args_list[2][0][0] # green 76
|
||||||
|
assert green_args["command"] == "node.set_value"
|
||||||
|
assert green_args["nodeId"] == 39
|
||||||
|
assert green_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert green_args["valueId"]["commandClass"] == 51
|
||||||
|
assert green_args["valueId"]["endpoint"] == 0
|
||||||
|
assert green_args["valueId"]["metadata"]["label"] == "Target value (Green)"
|
||||||
|
assert green_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert green_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert green_args["value"] == 76
|
||||||
|
blue_args = client.async_send_json_message.call_args_list[3][0][0] # blue 255
|
||||||
|
assert blue_args["command"] == "node.set_value"
|
||||||
|
assert blue_args["nodeId"] == 39
|
||||||
|
assert blue_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert blue_args["valueId"]["commandClass"] == 51
|
||||||
|
assert blue_args["valueId"]["endpoint"] == 0
|
||||||
|
assert blue_args["valueId"]["metadata"]["label"] == "Target value (Blue)"
|
||||||
|
assert blue_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert blue_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert blue_args["value"] == 255
|
||||||
|
|
||||||
|
# Test rgb color update from value updated event
|
||||||
|
red_event = Event(
|
||||||
|
type="value updated",
|
||||||
|
data={
|
||||||
|
"source": "node",
|
||||||
|
"event": "value updated",
|
||||||
|
"nodeId": 39,
|
||||||
|
"args": {
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"newValue": 255,
|
||||||
|
"prevValue": 0,
|
||||||
|
"propertyKeyName": "Red",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
green_event = deepcopy(red_event)
|
||||||
|
green_event.data["args"].update({"newValue": 76, "propertyKeyName": "Green"})
|
||||||
|
blue_event = deepcopy(red_event)
|
||||||
|
blue_event.data["args"]["propertyKeyName"] = "Blue"
|
||||||
|
warm_white_event = deepcopy(red_event)
|
||||||
|
warm_white_event.data["args"].update(
|
||||||
|
{"newValue": 0, "propertyKeyName": "Warm White"}
|
||||||
|
)
|
||||||
|
node.receive_event(warm_white_event)
|
||||||
|
node.receive_event(red_event)
|
||||||
|
node.receive_event(green_event)
|
||||||
|
node.receive_event(blue_event)
|
||||||
|
|
||||||
|
state = hass.states.get(BULB_6_MULTI_COLOR_LIGHT_ENTITY)
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
assert state.attributes[ATTR_BRIGHTNESS] == 255
|
||||||
|
assert state.attributes[ATTR_COLOR_TEMP] == 370
|
||||||
|
assert state.attributes[ATTR_RGB_COLOR] == (255, 76, 255)
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test turning on with same rgb color
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_RGB_COLOR: (255, 76, 255)},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 0
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test turning on with color temp
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_COLOR_TEMP: 170},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 5
|
||||||
|
red_args = client.async_send_json_message.call_args_list[0][0][0] # red 0
|
||||||
|
assert red_args["command"] == "node.set_value"
|
||||||
|
assert red_args["nodeId"] == 39
|
||||||
|
assert red_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert red_args["valueId"]["commandClass"] == 51
|
||||||
|
assert red_args["valueId"]["endpoint"] == 0
|
||||||
|
assert red_args["valueId"]["metadata"]["label"] == "Target value (Red)"
|
||||||
|
assert red_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert red_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert red_args["value"] == 0
|
||||||
|
red_args = client.async_send_json_message.call_args_list[1][0][0] # green 0
|
||||||
|
assert red_args["command"] == "node.set_value"
|
||||||
|
assert red_args["nodeId"] == 39
|
||||||
|
assert red_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert red_args["valueId"]["commandClass"] == 51
|
||||||
|
assert red_args["valueId"]["endpoint"] == 0
|
||||||
|
assert red_args["valueId"]["metadata"]["label"] == "Target value (Green)"
|
||||||
|
assert red_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert red_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert red_args["value"] == 0
|
||||||
|
red_args = client.async_send_json_message.call_args_list[2][0][0] # blue 0
|
||||||
|
assert red_args["command"] == "node.set_value"
|
||||||
|
assert red_args["nodeId"] == 39
|
||||||
|
assert red_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert red_args["valueId"]["commandClass"] == 51
|
||||||
|
assert red_args["valueId"]["endpoint"] == 0
|
||||||
|
assert red_args["valueId"]["metadata"]["label"] == "Target value (Blue)"
|
||||||
|
assert red_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert red_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert red_args["value"] == 0
|
||||||
|
warm_args = client.async_send_json_message.call_args_list[3][0][0] # warm white 0
|
||||||
|
assert warm_args["command"] == "node.set_value"
|
||||||
|
assert warm_args["nodeId"] == 39
|
||||||
|
assert warm_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert warm_args["valueId"]["commandClass"] == 51
|
||||||
|
assert warm_args["valueId"]["endpoint"] == 0
|
||||||
|
assert warm_args["valueId"]["metadata"]["label"] == "Target value (Warm White)"
|
||||||
|
assert warm_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert warm_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert warm_args["value"] == 20
|
||||||
|
red_args = client.async_send_json_message.call_args_list[4][0][0] # cold white
|
||||||
|
assert red_args["command"] == "node.set_value"
|
||||||
|
assert red_args["nodeId"] == 39
|
||||||
|
assert red_args["valueId"]["commandClassName"] == "Color Switch"
|
||||||
|
assert red_args["valueId"]["commandClass"] == 51
|
||||||
|
assert red_args["valueId"]["endpoint"] == 0
|
||||||
|
assert red_args["valueId"]["metadata"]["label"] == "Target value (Cold White)"
|
||||||
|
assert red_args["valueId"]["property"] == "targetColor"
|
||||||
|
assert red_args["valueId"]["propertyName"] == "targetColor"
|
||||||
|
assert red_args["value"] == 235
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test color temp update from value updated event
|
||||||
|
red_event = Event(
|
||||||
|
type="value updated",
|
||||||
|
data={
|
||||||
|
"source": "node",
|
||||||
|
"event": "value updated",
|
||||||
|
"nodeId": 39,
|
||||||
|
"args": {
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"newValue": 0,
|
||||||
|
"prevValue": 255,
|
||||||
|
"propertyKeyName": "Red",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
green_event = deepcopy(red_event)
|
||||||
|
green_event.data["args"].update(
|
||||||
|
{"newValue": 0, "prevValue": 76, "propertyKeyName": "Green"}
|
||||||
|
)
|
||||||
|
blue_event = deepcopy(red_event)
|
||||||
|
blue_event.data["args"]["propertyKeyName"] = "Blue"
|
||||||
|
warm_white_event = deepcopy(red_event)
|
||||||
|
warm_white_event.data["args"].update(
|
||||||
|
{"newValue": 20, "propertyKeyName": "Warm White"}
|
||||||
|
)
|
||||||
|
cold_white_event = deepcopy(red_event)
|
||||||
|
cold_white_event.data["args"].update(
|
||||||
|
{"newValue": 235, "propertyKeyName": "Cold White"}
|
||||||
|
)
|
||||||
|
node.receive_event(red_event)
|
||||||
|
node.receive_event(green_event)
|
||||||
|
node.receive_event(blue_event)
|
||||||
|
node.receive_event(warm_white_event)
|
||||||
|
node.receive_event(cold_white_event)
|
||||||
|
|
||||||
|
state = hass.states.get(BULB_6_MULTI_COLOR_LIGHT_ENTITY)
|
||||||
|
assert state.state == STATE_ON
|
||||||
|
assert state.attributes[ATTR_BRIGHTNESS] == 255
|
||||||
|
assert state.attributes[ATTR_COLOR_TEMP] == 170
|
||||||
|
assert state.attributes[ATTR_RGB_COLOR] == (255, 255, 255)
|
||||||
|
|
||||||
|
# Test turning on with same color temp
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_on",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY, ATTR_COLOR_TEMP: 170},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 0
|
||||||
|
|
||||||
|
client.async_send_json_message.reset_mock()
|
||||||
|
|
||||||
|
# Test turning off
|
||||||
|
await hass.services.async_call(
|
||||||
|
"light",
|
||||||
|
"turn_off",
|
||||||
|
{"entity_id": BULB_6_MULTI_COLOR_LIGHT_ENTITY},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
assert len(client.async_send_json_message.call_args_list) == 1
|
||||||
|
args = client.async_send_json_message.call_args[0][0]
|
||||||
|
assert args["command"] == "node.set_value"
|
||||||
|
assert args["nodeId"] == 39
|
||||||
|
assert args["valueId"] == {
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetValue",
|
||||||
|
"propertyName": "targetValue",
|
||||||
|
"metadata": {
|
||||||
|
"label": "Target value",
|
||||||
|
"max": 99,
|
||||||
|
"min": 0,
|
||||||
|
"type": "number",
|
||||||
|
"readable": True,
|
||||||
|
"writeable": True,
|
||||||
|
"label": "Target value",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
assert args["value"] == 0
|
|
@ -0,0 +1,632 @@
|
||||||
|
{
|
||||||
|
"nodeId": 39,
|
||||||
|
"index": 0,
|
||||||
|
"installerIcon": 1536,
|
||||||
|
"userIcon": 1536,
|
||||||
|
"status": 4,
|
||||||
|
"ready": true,
|
||||||
|
"deviceClass": {
|
||||||
|
"basic": "Static Controller",
|
||||||
|
"generic": "Multilevel Switch",
|
||||||
|
"specific": "Multilevel Power Switch",
|
||||||
|
"mandatorySupportedCCs": [
|
||||||
|
"Basic",
|
||||||
|
"Multilevel Switch",
|
||||||
|
"All Switch"
|
||||||
|
],
|
||||||
|
"mandatoryControlCCs": []
|
||||||
|
},
|
||||||
|
"isListening": true,
|
||||||
|
"isFrequentListening": false,
|
||||||
|
"isRouting": true,
|
||||||
|
"maxBaudRate": 40000,
|
||||||
|
"isSecure": "unknown",
|
||||||
|
"version": 4,
|
||||||
|
"isBeaming": true,
|
||||||
|
"manufacturerId": 881,
|
||||||
|
"productId": 2,
|
||||||
|
"productType": 259,
|
||||||
|
"firmwareVersion": "2.0",
|
||||||
|
"zwavePlusVersion": 1,
|
||||||
|
"nodeType": 0,
|
||||||
|
"roleType": 5,
|
||||||
|
"deviceConfig": {
|
||||||
|
"manufacturerId": 881,
|
||||||
|
"manufacturer": "Aeotec Ltd.",
|
||||||
|
"label": "ZWA002",
|
||||||
|
"description": "Bulb 6 Multi-Color",
|
||||||
|
"devices": [
|
||||||
|
{
|
||||||
|
"productType": "0x0003",
|
||||||
|
"productId": "0x0002"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"productType": "0x0103",
|
||||||
|
"productId": "0x0002"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"firmwareVersion": {
|
||||||
|
"min": "0.0",
|
||||||
|
"max": "255.255"
|
||||||
|
},
|
||||||
|
"paramInformation": {
|
||||||
|
"_map": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"label": "ZWA002",
|
||||||
|
"neighbors": [
|
||||||
|
1,
|
||||||
|
32
|
||||||
|
],
|
||||||
|
"interviewAttempts": 1,
|
||||||
|
"endpoints": [
|
||||||
|
{
|
||||||
|
"nodeId": 39,
|
||||||
|
"index": 0,
|
||||||
|
"installerIcon": 1536,
|
||||||
|
"userIcon": 1536
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetValue",
|
||||||
|
"propertyName": "targetValue",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 99,
|
||||||
|
"label": "Target value"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "duration",
|
||||||
|
"propertyName": "duration",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"label": "Transition duration"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentValue",
|
||||||
|
"propertyName": "currentValue",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 99,
|
||||||
|
"label": "Current value"
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "Up",
|
||||||
|
"propertyName": "Up",
|
||||||
|
"metadata": {
|
||||||
|
"type": "boolean",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"label": "Perform a level change (Up)",
|
||||||
|
"ccSpecific": {
|
||||||
|
"switchType": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Multilevel Switch",
|
||||||
|
"commandClass": 38,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "Down",
|
||||||
|
"propertyName": "Down",
|
||||||
|
"metadata": {
|
||||||
|
"type": "boolean",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"label": "Perform a level change (Down)",
|
||||||
|
"ccSpecific": {
|
||||||
|
"switchType": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "duration",
|
||||||
|
"propertyName": "duration",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"label": "Transition duration"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"propertyKey": 0,
|
||||||
|
"propertyName": "currentColor",
|
||||||
|
"propertyKeyName": "Warm White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Current value (Warm White)",
|
||||||
|
"description": "The current value of the Warm White color."
|
||||||
|
},
|
||||||
|
"value": 255
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"propertyKey": 1,
|
||||||
|
"propertyName": "currentColor",
|
||||||
|
"propertyKeyName": "Cold White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Current value (Cold White)",
|
||||||
|
"description": "The current value of the Cold White color."
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"propertyKey": 2,
|
||||||
|
"propertyName": "currentColor",
|
||||||
|
"propertyKeyName": "Red",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Current value (Red)",
|
||||||
|
"description": "The current value of the Red color."
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"propertyKey": 3,
|
||||||
|
"propertyName": "currentColor",
|
||||||
|
"propertyKeyName": "Green",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Current value (Green)",
|
||||||
|
"description": "The current value of the Green color."
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "currentColor",
|
||||||
|
"propertyKey": 4,
|
||||||
|
"propertyName": "currentColor",
|
||||||
|
"propertyKeyName": "Blue",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Current value (Blue)",
|
||||||
|
"description": "The current value of the Blue color."
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetColor",
|
||||||
|
"propertyKey": 0,
|
||||||
|
"propertyName": "targetColor",
|
||||||
|
"propertyKeyName": "Warm White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Target value (Warm White)",
|
||||||
|
"description": "The target value of the Warm White color."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetColor",
|
||||||
|
"propertyKey": 1,
|
||||||
|
"propertyName": "targetColor",
|
||||||
|
"propertyKeyName": "Cold White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Target value (Cold White)",
|
||||||
|
"description": "The target value of the Cold White color."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetColor",
|
||||||
|
"propertyKey": 2,
|
||||||
|
"propertyName": "targetColor",
|
||||||
|
"propertyKeyName": "Red",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Target value (Red)",
|
||||||
|
"description": "The target value of the Red color."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetColor",
|
||||||
|
"propertyKey": 3,
|
||||||
|
"propertyName": "targetColor",
|
||||||
|
"propertyKeyName": "Green",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Target value (Green)",
|
||||||
|
"description": "The target value of the Green color."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Color Switch",
|
||||||
|
"commandClass": 51,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "targetColor",
|
||||||
|
"propertyKey": 4,
|
||||||
|
"propertyName": "targetColor",
|
||||||
|
"propertyKeyName": "Blue",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"min": 0,
|
||||||
|
"max": 255,
|
||||||
|
"label": "Target value (Blue)",
|
||||||
|
"description": "The target value of the Blue color."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 1,
|
||||||
|
"propertyName": "Use custom mode for LED animations",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 2,
|
||||||
|
"default": 0,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": false,
|
||||||
|
"states": {
|
||||||
|
"0": "Disable",
|
||||||
|
"1": "Blink Colors in order mode",
|
||||||
|
"2": "Randomized blink color mode"
|
||||||
|
},
|
||||||
|
"label": "Use custom mode for LED animations",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 2,
|
||||||
|
"propertyName": "Enable/Disable Strobe over Custom Color",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 1,
|
||||||
|
"default": 0,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": false,
|
||||||
|
"states": {
|
||||||
|
"0": "Disable",
|
||||||
|
"1": "Enable"
|
||||||
|
},
|
||||||
|
"label": "Enable/Disable Strobe over Custom Color",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 3,
|
||||||
|
"propertyName": "Rate of change to next color in Custom Mode",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 4,
|
||||||
|
"min": 5,
|
||||||
|
"max": 8640000,
|
||||||
|
"default": 50,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": true,
|
||||||
|
"label": "Rate of change to next color in Custom Mode",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 16,
|
||||||
|
"propertyName": "Ramp rate when dimming using Multilevel Switch",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"default": 20,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": true,
|
||||||
|
"label": "Ramp rate when dimming using Multilevel Switch",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 80,
|
||||||
|
"propertyName": "Enable notifications",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 1,
|
||||||
|
"min": 0,
|
||||||
|
"max": 1,
|
||||||
|
"default": 1,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": false,
|
||||||
|
"states": {
|
||||||
|
"0": "Nothing",
|
||||||
|
"1": "Basic CC report"
|
||||||
|
},
|
||||||
|
"label": "Enable notifications",
|
||||||
|
"description": "Enable notifications to associated devices (Group 1) when the state is changed",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 81,
|
||||||
|
"propertyName": "Adjust color component of Warm White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 2,
|
||||||
|
"min": 2700,
|
||||||
|
"max": 4999,
|
||||||
|
"default": 2700,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": true,
|
||||||
|
"label": "Adjust color component of Warm White",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 2700
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 82,
|
||||||
|
"propertyName": "Adjust color component of Cold White",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 2,
|
||||||
|
"min": 5000,
|
||||||
|
"max": 6500,
|
||||||
|
"default": 6500,
|
||||||
|
"format": 0,
|
||||||
|
"allowManualEntry": true,
|
||||||
|
"label": "Adjust color component of Cold White",
|
||||||
|
"isFromConfig": true
|
||||||
|
},
|
||||||
|
"value": 6500
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Configuration",
|
||||||
|
"commandClass": 112,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": 4,
|
||||||
|
"propertyName": "Set color that LED Bulb blinks in (Blink Mode)",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": false,
|
||||||
|
"writeable": true,
|
||||||
|
"valueSize": 1,
|
||||||
|
"min": 1,
|
||||||
|
"max": 255,
|
||||||
|
"default": 1,
|
||||||
|
"format": 1,
|
||||||
|
"allowManualEntry": true,
|
||||||
|
"label": "Set color that LED Bulb blinks in (Blink Mode)",
|
||||||
|
"isFromConfig": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Manufacturer Specific",
|
||||||
|
"commandClass": 114,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "manufacturerId",
|
||||||
|
"propertyName": "manufacturerId",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 65535,
|
||||||
|
"label": "Manufacturer ID"
|
||||||
|
},
|
||||||
|
"value": 881
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Manufacturer Specific",
|
||||||
|
"commandClass": 114,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "productType",
|
||||||
|
"propertyName": "productType",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 65535,
|
||||||
|
"label": "Product type"
|
||||||
|
},
|
||||||
|
"value": 259
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Manufacturer Specific",
|
||||||
|
"commandClass": 114,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "productId",
|
||||||
|
"propertyName": "productId",
|
||||||
|
"metadata": {
|
||||||
|
"type": "number",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"min": 0,
|
||||||
|
"max": 65535,
|
||||||
|
"label": "Product ID"
|
||||||
|
},
|
||||||
|
"value": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Version",
|
||||||
|
"commandClass": 134,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "libraryType",
|
||||||
|
"propertyName": "libraryType",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"label": "Libary type"
|
||||||
|
},
|
||||||
|
"value": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Version",
|
||||||
|
"commandClass": 134,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "protocolVersion",
|
||||||
|
"propertyName": "protocolVersion",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"label": "Z-Wave protocol version"
|
||||||
|
},
|
||||||
|
"value": "4.38"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Version",
|
||||||
|
"commandClass": 134,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "firmwareVersions",
|
||||||
|
"propertyName": "firmwareVersions",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"label": "Z-Wave chip firmware versions"
|
||||||
|
},
|
||||||
|
"value": [
|
||||||
|
"2.0"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"commandClassName": "Version",
|
||||||
|
"commandClass": 134,
|
||||||
|
"endpoint": 0,
|
||||||
|
"property": "hardwareVersion",
|
||||||
|
"propertyName": "hardwareVersion",
|
||||||
|
"metadata": {
|
||||||
|
"type": "any",
|
||||||
|
"readable": true,
|
||||||
|
"writeable": false,
|
||||||
|
"label": "Z-Wave chip hardware version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue