Support for illuminance sensor entities on zigbee.mqtt

This commit is contained in:
Fabio Manganiello 2022-11-30 02:16:56 +01:00
parent 09d70e2ff1
commit 1ab85f99d9
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -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(