Extended humidity sensors detection for zigbee.mqtt

This commit is contained in:
Fabio Manganiello 2022-11-30 01:24:35 +01:00
parent 16c24d799d
commit b6370b51da
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1598,7 +1598,7 @@ class ZigbeeMqttPlugin(MqttPlugin): # lgtm [py/missing-call-to-init]
entity_type = VoltageSensor entity_type = VoltageSensor
elif exposed.get('property', '').endswith('temperature'): elif exposed.get('property', '').endswith('temperature'):
entity_type = TemperatureSensor entity_type = TemperatureSensor
elif exposed.get('property', '').endswith('humidity'): elif re.search(r'(humidity|moisture)$', exposed.get('property' '')):
entity_type = HumiditySensor entity_type = HumiditySensor
elif exposed.get('type') == 'binary': elif exposed.get('type') == 'binary':
entity_type = BinarySensor entity_type = BinarySensor