Skip to content

Commit

Permalink
Merge pull request #183 from kongo09/181-support-for-ac3220ac3221
Browse files Browse the repository at this point in the history
add new models AC3210, AC3220, AC3221
  • Loading branch information
kongo09 authored Nov 4, 2024
2 parents 0c44c14 + 2a8bc9b commit 1373af4
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 51 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Note: `configuration.yaml` is no longer supported and your configuration is not

## Supported models

Note: Some of these models seem to have a newer firmware that does not allow local connections anymore. If you buy the device with the intention to manage it via Home Assistant, make sure you can return it, if the integration doesn't work for you.

- AC0850/11 AWS_Philips_AIR
- AC0850/11 AWS_Philips_AIR_Combo
- AC0850/20 AWS_Philips_AIR
Expand All @@ -79,6 +81,9 @@ Note: `configuration.yaml` is no longer supported and your configuration is not
- AC3039
- AC3055
- AC3059
- AC3210
- AC3220
- AC3221
- AC3421
- AC3259
- AC3737
Expand Down
3 changes: 3 additions & 0 deletions custom_components/philips_airpurifier_coap/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class FanModel(StrEnum):
AC3039 = "AC3039"
AC3055 = "AC3055"
AC3059 = "AC3059"
AC3210 = "AC3210"
AC3220 = "AC3220"
AC3221 = "AC3221"
AC3259 = "AC3259"
AC3421 = "AC3421"
AC3737 = "AC3737"
Expand Down
129 changes: 78 additions & 51 deletions custom_components/philips_airpurifier_coap/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,78 @@ class PhilipsAC3059(PhilipsAC305x):
"""AC3059."""


# this device seems similar to the AMF family
class PhilipsAC32xx(PhilipsNew2GenericCoAPFan):
"""AC32xx family."""

AVAILABLE_PRESET_MODES = {
PresetMode.AUTO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 0,
},
PresetMode.MEDIUM: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 19,
},
PresetMode.TURBO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 18,
},
PresetMode.SLEEP: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 17,
},
}
AVAILABLE_SPEEDS = {
PresetMode.SPEED_1: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 1,
},
PresetMode.SPEED_2: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 2,
},
PresetMode.SPEED_3: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 3,
},
PresetMode.SPEED_4: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 4,
},
PresetMode.SPEED_5: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 5,
},
}

AVAILABLE_LIGHTS = [PhilipsApi.NEW2_DISPLAY_BACKLIGHT3]
AVAILABLE_SWITCHES = [
PhilipsApi.NEW2_CHILD_LOCK,
PhilipsApi.NEW2_BEEP,
PhilipsApi.NEW2_AUTO_PLUS_AI,
]
AVAILABLE_SELECTS = [
PhilipsApi.NEW2_TIMER2,
PhilipsApi.NEW2_LAMP_MODE,
PhilipsApi.NEW2_PREFERRED_INDEX,
]


class PhilipsAC3210(PhilipsAC32xx):
"""AC3210."""

AVAILABLE_SELECTS = [PhilipsApi.NEW_PREFERRED_INDEX]


class PhilipsAC3220(PhilipsAC3210):
"""AC3220."""


class PhilipsAC3221(PhilipsAC3210):
"""AC3221."""


class PhilipsAC3259(PhilipsGenericCoAPFan):
"""AC3259."""

Expand Down Expand Up @@ -1572,58 +1644,10 @@ class PhilipsAC385886(PhilipsAC385x51):
"""AC3858/86."""


# this device seems similar to the AMF family
class PhilipsAC4220(PhilipsNew2GenericCoAPFan):
"""AC4220 family."""

AVAILABLE_PRESET_MODES = {
PresetMode.AUTO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 0,
},
PresetMode.MEDIUM: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 19,
},
PresetMode.TURBO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 18,
},
PresetMode.SLEEP: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 17,
},
}
AVAILABLE_SPEEDS = {
PresetMode.SPEED_1: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 1,
},
PresetMode.SPEED_2: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 2,
},
PresetMode.SPEED_3: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 3,
},
PresetMode.SPEED_4: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 4,
},
PresetMode.SPEED_5: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_B: 5,
},
}
class PhilipsAC4220(PhilipsAC32xx):
"""AC4220."""

AVAILABLE_LIGHTS = [PhilipsApi.NEW2_DISPLAY_BACKLIGHT3]
AVAILABLE_SWITCHES = [
PhilipsApi.NEW2_CHILD_LOCK,
PhilipsApi.NEW2_BEEP,
PhilipsApi.NEW2_AUTO_PLUS_AI,
]
AVAILABLE_SELECTS = [PhilipsApi.NEW2_TIMER2, PhilipsApi.NEW2_LAMP_MODE]
AVAILABLE_SELECTS = [PhilipsApi.NEW2_GAS_PREFERRED_INDEX]


class PhilipsAC4221(PhilipsAC4220):
Expand Down Expand Up @@ -2043,6 +2067,9 @@ class PhilipsCX3550(PhilipsNew2GenericCoAPFan):
FanModel.AC3039: PhilipsAC3039,
FanModel.AC3055: PhilipsAC3055,
FanModel.AC3059: PhilipsAC3059,
FanModel.AC3210: PhilipsAC3210,
FanModel.AC3220: PhilipsAC3220,
FanModel.AC3221: PhilipsAC3221,
FanModel.AC3259: PhilipsAC3259,
FanModel.AC3421: PhilipsAC3421,
FanModel.AC3737: PhilipsAC3737,
Expand Down

0 comments on commit 1373af4

Please sign in to comment.