Skip to content

Commit

Permalink
Merge branch 'JohNan:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
androidand authored Jan 28, 2024
2 parents 3532990 + 09c995f commit a896079
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions custom_components/wellbeing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

FILTER_TYPE = {
48: "BREEZE Complete air filter",
49: "CLEAN Ultrafine particle filter",
51: "CARE Ultimate protect filter",
64: "Breeze 360 filter",
67: "Breeze 360 filter",
96: "Breeze 360 filter",
99: "Breeze 360 filter",
100: "Fresh 360 filter",
192: "FRESH Odour protect filter",
0: "Filter"
}
Expand Down Expand Up @@ -117,18 +120,12 @@ def __init__(self, name, pnc_id, model) -> None:
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[data.get('FilterType_1', 0)]} Life",
name=f"{FILTER_TYPE.get(data.get('FilterType_1', 0), 'Unknown filter')} Life",
attr='FilterLife_1',
unit=PERCENTAGE
),
ApplianceSensor(
name=f"{FILTER_TYPE[data.get('FilterType_2', 0)]} Life",
name=f"{FILTER_TYPE.get(data.get('FilterType_2', 0), 'Unknown filter')} Life",
attr='FilterLife_2',
unit=PERCENTAGE
),
Expand All @@ -144,16 +141,10 @@ def _create_entities(data):

a9_entities = [
ApplianceSensor(
name=f"{FILTER_TYPE.get(data.get('FilterType', 0), 'Filter')} Life",
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 = [
Expand All @@ -172,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',
Expand Down

0 comments on commit a896079

Please sign in to comment.