core/homeassistant/components/vesync
Ethan Madden e30a9d1fc0
Fix VeSync air_quality fan attribute (#71771)
* Refactor attribute inclusion for VeSync fans.

A recent change to pyvesync (introduced in 2.2) changed `air_quality` to
refer to air quality as an integer representation of perceived air
quality rather than a direct reading of the PM2.5 sensor. With 2.3 the
PM2.5 sensor access was restored as `air_quality_value`. Unfortunately,
`air_quality_value` was not added as an attribute on the fan object, and
rather only exists in the `details` dictionary on the fan object.

* Update homeassistant/components/vesync/fan.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Rename `air_quality_value` attribute to `pm25`

This should make it more clear what the attribute actually represents

* `air_quality` attribute reports `air_quality_value`

This restores previous behavior for this integration to what it was
before the `pyvesync==2.02` upgrade, using the `air_quality` attribute
to report pm2.5 concentrations (formerly `air_quality`) rather the
vague measurement now reported by `air_quality`.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-16 10:30:49 +02:00
..
translations
__init__.py
common.py
config_flow.py
const.py
fan.py
light.py
manifest.json
sensor.py
services.yaml
strings.json
switch.py