From 1ab85f99d9751e2dff881973a41a83b3979a8cbb Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 30 Nov 2022 02:16:56 +0100 Subject: [PATCH] Support for illuminance sensor entities on `zigbee.mqtt` --- platypush/plugins/zigbee/mqtt/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platypush/plugins/zigbee/mqtt/__init__.py b/platypush/plugins/zigbee/mqtt/__init__.py index 4a227b4b39..96ff971ee5 100644 --- a/platypush/plugins/zigbee/mqtt/__init__.py +++ b/platypush/plugins/zigbee/mqtt/__init__.py @@ -16,6 +16,7 @@ from platypush.entities.electricity import ( VoltageSensor, ) from platypush.entities.humidity import HumiditySensor +from platypush.entities.illuminance import IlluminanceSensor from platypush.entities.lights import Light from platypush.entities.linkquality import LinkQuality from platypush.entities.sensors import ( @@ -1600,6 +1601,8 @@ class ZigbeeMqttPlugin(MqttPlugin): # lgtm [py/missing-call-to-init] entity_type = TemperatureSensor elif re.search(r'(humidity|moisture)$', exposed.get('property' '')): entity_type = HumiditySensor + elif re.search(r'(illuminance|luminosity)$', exposed.get('property' '')): + entity_type = IlluminanceSensor elif exposed.get('type') == 'binary': entity_type = BinarySensor sensor_args['value'] = sensor_args['value'] == exposed.get(