mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
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>
This commit is contained in:
parent
77d39f9c4f
commit
e30a9d1fc0
@ -171,8 +171,8 @@ class VeSyncFanHA(VeSyncDevice, FanEntity):
|
||||
if hasattr(self.smartfan, "night_light"):
|
||||
attr["night_light"] = self.smartfan.night_light
|
||||
|
||||
if hasattr(self.smartfan, "air_quality"):
|
||||
attr["air_quality"] = self.smartfan.air_quality
|
||||
if self.smartfan.details.get("air_quality_value") is not None:
|
||||
attr["air_quality"] = self.smartfan.details["air_quality_value"]
|
||||
|
||||
if hasattr(self.smartfan, "mode"):
|
||||
attr["mode"] = self.smartfan.mode
|
||||
|
@ -3,7 +3,7 @@
|
||||
"name": "VeSync",
|
||||
"documentation": "https://www.home-assistant.io/integrations/vesync",
|
||||
"codeowners": ["@markperdue", "@webdjoe", "@thegardenmonkey"],
|
||||
"requirements": ["pyvesync==2.0.2"],
|
||||
"requirements": ["pyvesync==2.0.3"],
|
||||
"config_flow": true,
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["pyvesync"]
|
||||
|
@ -1999,7 +1999,7 @@ pyvera==0.3.13
|
||||
pyversasense==0.0.6
|
||||
|
||||
# homeassistant.components.vesync
|
||||
pyvesync==2.0.2
|
||||
pyvesync==2.0.3
|
||||
|
||||
# homeassistant.components.vizio
|
||||
pyvizio==0.1.57
|
||||
|
@ -1322,7 +1322,7 @@ pyuptimerobot==22.2.0
|
||||
pyvera==0.3.13
|
||||
|
||||
# homeassistant.components.vesync
|
||||
pyvesync==2.0.2
|
||||
pyvesync==2.0.3
|
||||
|
||||
# homeassistant.components.vizio
|
||||
pyvizio==0.1.57
|
||||
|
Loading…
x
Reference in New Issue
Block a user