From 8dce095f50f9529d52ddb7333323abce2d78ec14 Mon Sep 17 00:00:00 2001 From: kongo09 Date: Sun, 27 Oct 2024 09:40:00 +0100 Subject: [PATCH 1/3] add AC5660 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f353324c..c0022032 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Note: `configuration.yaml` is no longer supported and your configuration is not - AC4236 - AC4550 - AC4558 +- AC5660 - AC5659 - AMF765 - AMF870 From ead6e6f3b8d2d68494a5ad9821cad2d72dcb3feb Mon Sep 17 00:00:00 2001 From: kongo09 Date: Sun, 27 Oct 2024 13:54:07 +0100 Subject: [PATCH 2/3] add AC5660 --- custom_components/philips_airpurifier_coap/const.py | 8 +++++--- .../philips_airpurifier_coap/icons/pap/pm25.svg | 2 +- .../philips_airpurifier_coap/icons/pap/pm25b.svg | 2 +- .../philips_airpurifier_coap/icons/pap/pollution_mode.svg | 4 ++++ custom_components/philips_airpurifier_coap/philips.py | 7 ++++++- 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 custom_components/philips_airpurifier_coap/icons/pap/pollution_mode.svg diff --git a/custom_components/philips_airpurifier_coap/const.py b/custom_components/philips_airpurifier_coap/const.py index 166a7eb9..6e36cdbf 100644 --- a/custom_components/philips_airpurifier_coap/const.py +++ b/custom_components/philips_airpurifier_coap/const.py @@ -59,6 +59,7 @@ class ICON(StrEnum): PURIFICATION_ONLY_MODE = "pap:purification_only_mode" TWO_IN_ONE_MODE = "pap:two_in_one_mode" BACTERIA_VIRUS_MODE = "pap:bacteria_virus_mode" + POLLUTION_MODE = "pap:pollution_mode" NANOPROTECT_FILTER = "pap:nanoprotect_filter" FILTER_REPLACEMENT = "pap:filter_replacement" WATER_REFILL = "pap:water_refill" @@ -134,6 +135,7 @@ class FanModel(StrEnum): AC4550 = "AC4550" AC4558 = "AC4558" AC5659 = "AC5659" + AC5660 = "AC5660" AMF765 = "AMF765" AMF870 = "AMF870" CX3550 = "CX3550" @@ -177,19 +179,19 @@ class PresetMode: AUTO: ICON.AUTO_MODE, AUTO_GENERAL: ICON.AUTO_MODE, BACTERIA: ICON.BACTERIA_VIRUS_MODE, + POLLUTION: ICON.POLLUTION_MODE, SPEED_GENTLE_1: ICON.SPEED_1, SPEED_1: ICON.SPEED_1, SPEED_2: ICON.SPEED_2, SPEED_3: ICON.SPEED_3, + TURBO: ICON.SPEED_3, # we use the sleep mode icon for all related modes GENTLE: ICON.SLEEP_MODE, NIGHT: ICON.SLEEP_MODE, SLEEP: ICON.SLEEP_MODE, - TURBO: ICON.SPEED_3, # unfortunately, the allergy sleep mode has the same icon as the auto mode on the device SLEEP_ALLERGY: ICON.AUTO_MODE, - # some devices have a gas and a pollution mode, but there doesn't seem to be a Philips icon for that - POLLUTION: ICON.AUTO_MODE, + # some devices have a gas mode, but there doesn't seem to be a Philips icon for that GAS: ICON.AUTO_MODE, } diff --git a/custom_components/philips_airpurifier_coap/icons/pap/pm25.svg b/custom_components/philips_airpurifier_coap/icons/pap/pm25.svg index d26157ae..590ef5dd 100644 --- a/custom_components/philips_airpurifier_coap/icons/pap/pm25.svg +++ b/custom_components/philips_airpurifier_coap/icons/pap/pm25.svg @@ -1,5 +1,5 @@ - + diff --git a/custom_components/philips_airpurifier_coap/icons/pap/pm25b.svg b/custom_components/philips_airpurifier_coap/icons/pap/pm25b.svg index b7acf739..91d4e9e3 100644 --- a/custom_components/philips_airpurifier_coap/icons/pap/pm25b.svg +++ b/custom_components/philips_airpurifier_coap/icons/pap/pm25b.svg @@ -1,4 +1,4 @@ - + diff --git a/custom_components/philips_airpurifier_coap/icons/pap/pollution_mode.svg b/custom_components/philips_airpurifier_coap/icons/pap/pollution_mode.svg new file mode 100644 index 00000000..99c2bc40 --- /dev/null +++ b/custom_components/philips_airpurifier_coap/icons/pap/pollution_mode.svg @@ -0,0 +1,4 @@ + + + + diff --git a/custom_components/philips_airpurifier_coap/philips.py b/custom_components/philips_airpurifier_coap/philips.py index b56a2c12..b0b00500 100644 --- a/custom_components/philips_airpurifier_coap/philips.py +++ b/custom_components/philips_airpurifier_coap/philips.py @@ -1674,7 +1674,7 @@ class PhilipsAC5659(PhilipsGenericCoAPFan): """AC5659.""" AVAILABLE_PRESET_MODES = { - PresetMode.AUTO: {PhilipsApi.POWER: "1", PhilipsApi.MODE: "P"}, + PresetMode.POLLUTION: {PhilipsApi.POWER: "1", PhilipsApi.MODE: "P"}, PresetMode.ALLERGEN: {PhilipsApi.POWER: "1", PhilipsApi.MODE: "A"}, PresetMode.BACTERIA: {PhilipsApi.POWER: "1", PhilipsApi.MODE: "B"}, # make speeds available as preset @@ -1734,6 +1734,10 @@ class PhilipsAC5659(PhilipsGenericCoAPFan): AVAILABLE_SELECTS = [PhilipsApi.PREFERRED_INDEX] +class PhilipsAC5660(PhilipsAC5659): + """AC5660.""" + + class PhilipsAMFxxx(PhilipsNew2GenericCoAPFan): """AMF family.""" @@ -1994,6 +1998,7 @@ class PhilipsCX3550(PhilipsNew2GenericCoAPFan): FanModel.AC4550: PhilipsAC4550, FanModel.AC4558: PhilipsAC4558, FanModel.AC5659: PhilipsAC5659, + FanModel.AC5660: PhilipsAC5660, FanModel.AMF765: PhilipsAMF765, FanModel.AMF870: PhilipsAMF870, FanModel.CX5120: PhilipsCX5120, From b0d04cf8b66135d9daaa34311c533ae2322290c0 Mon Sep 17 00:00:00 2001 From: kongo09 Date: Sun, 27 Oct 2024 13:55:36 +0100 Subject: [PATCH 3/3] add pollution mode --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c0022032..3df52c72 100644 --- a/README.md +++ b/README.md @@ -209,6 +209,7 @@ The integration also provides the original Philips icons for your use in the fro | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/purification_only_mode.svg) | purification_only_mode | | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/two_in_one_mode.svg) | two_in_one_mode | | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/bacteria_virus_mode.svg) | bacteria_virus_mode | +| ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/pollution_mode.svg) | pollution_mode | | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/nanoprotect_filter.svg) | nanoprotect_filter | | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/filter_replacement.svg) | filter_replacement | | ![Preview](./custom_components/philips_airpurifier_coap/icons/pap/water_refill.svg) | water_refill |