From 5defe67269a679cad7858009a45c75ee9b7907af Mon Sep 17 00:00:00 2001 From: Ethan Madden Date: Sat, 9 Jul 2022 10:51:47 -0700 Subject: [PATCH] `air_quality` and `filter_life` fixes for Pur131S (#74740) --- homeassistant/components/vesync/sensor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/vesync/sensor.py b/homeassistant/components/vesync/sensor.py index 2da6d8ea6b7..45018c79ca0 100644 --- a/homeassistant/components/vesync/sensor.py +++ b/homeassistant/components/vesync/sensor.py @@ -83,13 +83,12 @@ SENSORS: tuple[VeSyncSensorEntityDescription, ...] = ( native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, - value_fn=lambda device: device.details["filter_life"], + value_fn=lambda device: device.filter_life, exists_fn=lambda device: sku_supported(device, FILTER_LIFE_SUPPORTED), ), VeSyncSensorEntityDescription( key="air-quality", name="Air Quality", - state_class=SensorStateClass.MEASUREMENT, value_fn=lambda device: device.details["air_quality"], exists_fn=lambda device: sku_supported(device, AIR_QUALITY_SUPPORTED), ),