Bump zwave-js-server-python to 0.28.0 (#53302)

pull/53335/head
Raman Gupta 2021-07-22 02:37:10 -04:00 committed by GitHub
parent 1bde914075
commit b9a6ce77d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 45 additions and 33 deletions

View File

@ -70,7 +70,3 @@ ATTR_BROADCAST = "broadcast"
SERVICE_PING = "ping"
ADDON_SLUG = "core_zwave_js"
# Siren constants
TONE_ID_DEFAULT = 255
TONE_ID_OFF = 0

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import logging
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.model.node import NodeStatus
from zwave_js_server.const import NodeStatus
from zwave_js_server.model.value import Value as ZwaveValue, get_value_id
from homeassistant.config_entries import ConfigEntry
@ -213,13 +213,13 @@ class ZWaveBaseEntity(Entity):
# If we haven't found a value and check_all_endpoints is True, we should
# return the first value we can find on any other endpoint
if return_value is None and check_all_endpoints:
for endpoint_ in self.info.node.endpoints:
if endpoint_.index != self.info.primary_value.endpoint:
for endpoint_idx in self.info.node.endpoints:
if endpoint_idx != self.info.primary_value.endpoint:
value_id = get_value_id(
self.info.node,
command_class,
value_property,
endpoint=endpoint_.index,
endpoint=endpoint_idx,
property_key=value_property_key,
)
return_value = self.info.node.values.get(value_id)

View File

@ -3,7 +3,7 @@
"name": "Z-Wave JS",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zwave_js",
"requirements": ["zwave-js-server-python==0.27.1"],
"requirements": ["zwave-js-server-python==0.28.0"],
"codeowners": ["@home-assistant/z-wave"],
"dependencies": ["http", "websocket_api"],
"iot_class": "local_push"

View File

@ -4,6 +4,7 @@ from __future__ import annotations
from typing import Any
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import ToneID
from homeassistant.components.siren import DOMAIN as SIREN_DOMAIN, SirenEntity
from homeassistant.components.siren.const import (
@ -19,7 +20,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DATA_CLIENT, DOMAIN, TONE_ID_DEFAULT, TONE_ID_OFF
from .const import DATA_CLIENT, DOMAIN
from .discovery import ZwaveDiscoveryInfo
from .entity import ZWaveBaseEntity
@ -87,7 +88,7 @@ class ZwaveSirenEntity(ZWaveBaseEntity, SirenEntity):
options["volume"] = round(volume * 100)
# Play the default tone if a tone isn't provided
if tone is None:
await self.async_set_value(TONE_ID_DEFAULT, options)
await self.async_set_value(ToneID.DEFAULT, options)
return
tone_id = int(
@ -102,4 +103,4 @@ class ZwaveSirenEntity(ZWaveBaseEntity, SirenEntity):
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the device off."""
await self.async_set_value(TONE_ID_OFF)
await self.async_set_value(ToneID.OFF)

View File

@ -2461,4 +2461,4 @@ zigpy==0.35.2
zm-py==0.5.2
# homeassistant.components.zwave_js
zwave-js-server-python==0.27.1
zwave-js-server-python==0.28.0

View File

@ -1355,4 +1355,4 @@ zigpy-znp==0.5.1
zigpy==0.35.2
# homeassistant.components.zwave_js
zwave-js-server-python==0.27.1
zwave-js-server-python==0.28.0

View File

@ -35,6 +35,7 @@ from .common import (
AEON_SMART_SWITCH_LIGHT_ENTITY,
AIR_TEMPERATURE_SENSOR,
CLIMATE_DANFOSS_LC13_ENTITY,
CLIMATE_EUROTRONICS_SPIRIT_Z_ENTITY,
CLIMATE_RADIO_THERMOSTAT_ENTITY,
)
@ -805,7 +806,7 @@ async def test_multicast_set_value(
hass,
client,
climate_danfoss_lc_13,
climate_radio_thermostat_ct100_plus_different_endpoints,
climate_eurotronic_spirit_z,
integration,
):
"""Test multicast_set_value service."""
@ -816,7 +817,7 @@ async def test_multicast_set_value(
{
ATTR_ENTITY_ID: [
CLIMATE_DANFOSS_LC13_ENTITY,
CLIMATE_RADIO_THERMOSTAT_ENTITY,
CLIMATE_EUROTRONICS_SPIRIT_Z_ENTITY,
],
ATTR_COMMAND_CLASS: 117,
ATTR_PROPERTY: "local",
@ -829,7 +830,7 @@ async def test_multicast_set_value(
args = client.async_send_command.call_args[0][0]
assert args["command"] == "multicast_group.set_value"
assert args["nodeIDs"] == [
climate_radio_thermostat_ct100_plus_different_endpoints.node_id,
climate_eurotronic_spirit_z.node_id,
climate_danfoss_lc_13.node_id,
]
assert args["valueId"] == {
@ -847,7 +848,7 @@ async def test_multicast_set_value(
{
ATTR_ENTITY_ID: [
CLIMATE_DANFOSS_LC13_ENTITY,
CLIMATE_RADIO_THERMOSTAT_ENTITY,
CLIMATE_EUROTRONICS_SPIRIT_Z_ENTITY,
],
ATTR_COMMAND_CLASS: 117,
ATTR_PROPERTY: "local",
@ -860,7 +861,7 @@ async def test_multicast_set_value(
args = client.async_send_command.call_args[0][0]
assert args["command"] == "multicast_group.set_value"
assert args["nodeIDs"] == [
climate_radio_thermostat_ct100_plus_different_endpoints.node_id,
climate_eurotronic_spirit_z.node_id,
climate_danfoss_lc_13.node_id,
]
assert args["valueId"] == {
@ -937,7 +938,7 @@ async def test_multicast_set_value(
{
ATTR_ENTITY_ID: [
CLIMATE_DANFOSS_LC13_ENTITY,
CLIMATE_RADIO_THERMOSTAT_ENTITY,
CLIMATE_EUROTRONICS_SPIRIT_Z_ENTITY,
],
ATTR_COMMAND_CLASS: 117,
ATTR_PROPERTY: "local",

View File

@ -53,6 +53,7 @@ TONE_ID_VALUE_ID = {
"30": "30DOOR~1 (27 sec)",
"255": "default",
},
"valueChangeOptions": ["volume"],
},
}

View File

@ -2597,7 +2597,8 @@
"writeable": true,
"label": "Tone ID",
"min": 0,
"max": 255
"max": 255,
"valueChangeOptions": ["volume"]
}
},
{
@ -2726,7 +2727,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -2856,7 +2858,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -3011,7 +3014,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -3166,7 +3170,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -3321,7 +3326,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -3451,7 +3457,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{
@ -3581,7 +3588,8 @@
"29": "29UPWA~1 (2 sec)",
"30": "30DOOR~1 (27 sec)",
"255": "default"
}
},
"valueChangeOptions": ["volume"]
}
},
{

View File

@ -267,7 +267,8 @@
"min": 0,
"max": 255,
"label": "Target value (Warm White)",
"description": "The target value of the Warm White color."
"description": "The target value of the Warm White color.",
"valueChangeOptions": ["transitionDuration"]
}
},
{
@ -285,7 +286,8 @@
"min": 0,
"max": 255,
"label": "Target value (Cold White)",
"description": "The target value of the Cold White color."
"description": "The target value of the Cold White color.",
"valueChangeOptions": ["transitionDuration"]
}
},
{
@ -303,7 +305,8 @@
"min": 0,
"max": 255,
"label": "Target value (Red)",
"description": "The target value of the Red color."
"description": "The target value of the Red color.",
"valueChangeOptions": ["transitionDuration"]
}
},
{
@ -321,7 +324,8 @@
"min": 0,
"max": 255,
"label": "Target value (Green)",
"description": "The target value of the Green color."
"description": "The target value of the Green color.",
"valueChangeOptions": ["transitionDuration"]
}
},
{
@ -339,7 +343,8 @@
"min": 0,
"max": 255,
"label": "Target value (Blue)",
"description": "The target value of the Blue color."
"description": "The target value of the Blue color.",
"valueChangeOptions": ["transitionDuration"]
}
},
{