Bump zwave-js-server-python to 0.18.0 (#46787)

* updates to support changes in zwave-js-server-python

* bump lib version

* use named arguments for optional args

* re-add lost commits
This commit is contained in:
Raman Gupta 2021-02-20 03:50:00 -05:00 committed by GitHub
parent 26ce316c18
commit 788134cbc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 27 deletions

View file

@ -134,6 +134,7 @@ class ZWaveBaseEntity(Entity):
value_property: Union[str, int],
command_class: Optional[int] = None,
endpoint: Optional[int] = None,
value_property_key: Optional[int] = None,
value_property_key_name: Optional[str] = None,
add_to_watched_value_ids: bool = True,
check_all_endpoints: bool = False,
@ -146,16 +147,14 @@ class ZWaveBaseEntity(Entity):
if endpoint is None:
endpoint = self.info.primary_value.endpoint
# Build partial event data dictionary so we can change the endpoint later
partial_evt_data = {
"commandClass": command_class,
"property": value_property,
"propertyKeyName": value_property_key_name,
}
# lookup value by value_id
value_id = get_value_id(
self.info.node, {**partial_evt_data, "endpoint": endpoint}
self.info.node,
command_class,
value_property,
endpoint=endpoint,
property_key=value_property_key,
property_key_name=value_property_key_name,
)
return_value = self.info.node.values.get(value_id)
@ -166,7 +165,11 @@ class ZWaveBaseEntity(Entity):
if endpoint_.index != self.info.primary_value.endpoint:
value_id = get_value_id(
self.info.node,
{**partial_evt_data, "endpoint": endpoint_.index},
command_class,
value_property,
endpoint=endpoint_.index,
property_key=value_property_key,
property_key_name=value_property_key_name,
)
return_value = self.info.node.values.get(value_id)
if return_value: