Skip to content

Commit

Permalink
Merge pull request #177 from kongo09/146-request-for-model-ac5660
Browse files Browse the repository at this point in the history
146 request for model ac5660
  • Loading branch information
kongo09 authored Nov 2, 2024
2 parents 2bad917 + b0d04cf commit 095d89f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Note: `configuration.yaml` is no longer supported and your configuration is not
- AC4236
- AC4550
- AC4558
- AC5660
- AC5659
- AMF765
- AMF870
Expand Down Expand Up @@ -212,6 +213,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 |
Expand Down
8 changes: 5 additions & 3 deletions custom_components/philips_airpurifier_coap/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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"
Expand Down Expand Up @@ -139,6 +140,7 @@ class FanModel(StrEnum):
AC4550 = "AC4550"
AC4558 = "AC4558"
AC5659 = "AC5659"
AC5660 = "AC5660"
AMF765 = "AMF765"
AMF870 = "AMF870"
CX3550 = "CX3550"
Expand Down Expand Up @@ -182,19 +184,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,
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion custom_components/philips_airpurifier_coap/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,7 +1738,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
Expand Down Expand Up @@ -1798,6 +1798,10 @@ class PhilipsAC5659(PhilipsGenericCoAPFan):
AVAILABLE_SELECTS = [PhilipsApi.PREFERRED_INDEX]


class PhilipsAC5660(PhilipsAC5659):
"""AC5660."""


class PhilipsAMFxxx(PhilipsNew2GenericCoAPFan):
"""AMF family."""

Expand Down Expand Up @@ -2061,6 +2065,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,
Expand Down

0 comments on commit 095d89f

Please sign in to comment.