Xiaomi Air Purifier S2 illuminance sensor support#89208
Conversation
…l578/core into airpurifier-s2-illuminance-support
…l578/core into airpurifier-s2-illuminance-support
…l578/core into airpurifier-s2-illuminance-support
|
Hey there @rytilahti, @syssi, @starkillerOG, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
…l578/core into airpurifier-s2-illuminance-support
There was a problem hiding this comment.
Looks straightforward to me, thanks for the PR @kirill578!
Would you mind creating a PR to the upstream, so that also the future versions of the integration will have these sensors automatically exposed? The file which requires changes is https://github.com/rytilahti/python-miio/blob/master/miio/integrations/zhimi/airpurifier/airpurifier.py#L142 and https://python-miio.readthedocs.io/en/latest/contributing.html#status-containers describes the process of adding those decorators.
edit: looks like the docs are completely missing for this device.
Proposed change
Add sensor illuminance sensor support xiaomi s2 air purifier. The value is capped at 200 lm. The sensor is located on the top of the device.
Type of change
Additional information
The sensors are based on
PURIFIER_MIOT_SENSORSwith an additional of(ATTR_ILLUMINANCE,). I ended up hardcoding it as I am not sure if the base sensor set will ever change and I am pretty certain there are no other sensors on the device.Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: