FIX: zigbee2mqtt applies different logic to /<device_name> and /<device_name>/get

This commit is contained in:
Fabio Manganiello 2021-01-22 16:24:43 +01:00
parent 717ad5d88c
commit 31b110a06c

View file

@ -333,8 +333,10 @@ class ZigbeeMqttPlugin(MqttPlugin):
(default: query the default configured device). (default: query the default configured device).
:return: Key->value map of the device properties. :return: Key->value map of the device properties.
""" """
properties = self.publish(topic=self._topic(device + '/get'), properties = self.publish(topic=self._topic(device + ('/get' if property else '')),
reply_topic=self._topic(device), msg='', **self._mqtt_args(**kwargs)).output reply_topic=self._topic(device),
msg={property: ''} if property else '',
**self._mqtt_args(**kwargs)).output
if property: if property:
assert property in properties, 'No such property: ' + property assert property in properties, 'No such property: ' + property