From 09c995fff44bb3cf54aea52a2a12e4fcaf521ac6 Mon Sep 17 00:00:00 2001 From: hermanops <55062051+hermanops@users.noreply.github.com> Date: Sun, 28 Jan 2024 08:47:29 +0100 Subject: [PATCH] Fix purea9 (#72) * Add FRESH360 filter debug logs show I have: "FilterType": 100 which according to the APP is FRESH360 * fix name for eCO2 I think this should be adjusted, as the A9 doesn't return CO2. It does show ECO2 in the json. * moved sensor to common array after review from JohNan * eCO2 is a common entity now --- custom_components/wellbeing/api.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/custom_components/wellbeing/api.py b/custom_components/wellbeing/api.py index e4a4f77..2bf997c 100644 --- a/custom_components/wellbeing/api.py +++ b/custom_components/wellbeing/api.py @@ -36,6 +36,7 @@ 67: "Breeze 360 filter", 96: "Breeze 360 filter", 99: "Breeze 360 filter", + 100: "Fresh 360 filter", 192: "FRESH Odour protect filter", 0: "Filter" } @@ -118,12 +119,6 @@ def __init__(self, name, pnc_id, model) -> None: @staticmethod def _create_entities(data): a7_entities = [ - ApplianceSensor( - name="eCO2", - attr='ECO2', - unit=CONCENTRATION_PARTS_PER_MILLION, - device_class=SensorDeviceClass.CO2 - ), ApplianceSensor( name=f"{FILTER_TYPE.get(data.get('FilterType_1', 0), 'Unknown filter')} Life", attr='FilterLife_1', @@ -149,13 +144,7 @@ def _create_entities(data): name=f"{FILTER_TYPE.get(data.get('FilterType', 0), 'Unknown filter')} Life", attr='FilterLife', unit=PERCENTAGE - ), - ApplianceSensor( - name="CO2", - attr='CO2', - unit=CONCENTRATION_PARTS_PER_MILLION, - device_class=SensorDeviceClass.CO2 - ), + ) ] common_entities = [ @@ -174,6 +163,12 @@ def _create_entities(data): attr='TVOC', unit=CONCENTRATION_PARTS_PER_BILLION ), + ApplianceSensor( + name="eCO2", + attr='ECO2', + unit=CONCENTRATION_PARTS_PER_MILLION, + device_class=SensorDeviceClass.CO2 + ), ApplianceSensor( name="PM1", attr='PM1',