Skip to content

Commit

Permalink
make sleep allergy mode a switch
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Dec 23, 2024
1 parent cf2695c commit f10ea6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 5 additions & 0 deletions custom_components/philips_airpurifier_coap/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,11 @@ class PhilipsApi:
SWITCH_ON: 1,
SWITCH_OFF: 0,
},
PhilipsApi.NEW2_MODE_A: {
FanAttributes.LABEL: PresetMode.SLEEP_ALLERGY,
SWITCH_ON: 16,
SWITCH_OFF: 2,
},
PhilipsApi.NEW2_AUTO_QUICKDRY_MODE: {
FanAttributes.LABEL: FanAttributes.AUTO_QUICKDRY_MODE,
SWITCH_ON: 1,
Expand Down
10 changes: 1 addition & 9 deletions custom_components/philips_airpurifier_coap/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,27 +1226,18 @@ class PhilipsAC3420(PhilipsNew2GenericFan):
AVAILABLE_PRESET_MODES = {
PresetMode.AUTO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_A: 2,
PhilipsApi.NEW2_MODE_B: 0,
},
PresetMode.TURBO: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_A: 2,
PhilipsApi.NEW2_MODE_B: 18,
},
PresetMode.MEDIUM: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_A: 2,
PhilipsApi.NEW2_MODE_B: 19,
},
PresetMode.SLEEP: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_A: 2,
PhilipsApi.NEW2_MODE_B: 17,
},
PresetMode.SLEEP_ALLERGY: {
PhilipsApi.NEW2_POWER: 1,
PhilipsApi.NEW2_MODE_A: 16,
PhilipsApi.NEW2_MODE_B: 17,
},
}
Expand All @@ -1264,6 +1255,7 @@ class PhilipsAC3420(PhilipsNew2GenericFan):
PhilipsApi.NEW2_CHILD_LOCK,
PhilipsApi.NEW2_BEEP,
PhilipsApi.NEW2_AUTO_PLUS_AI,
PhilipsApi.NEW2_MODE_A, # sleep_allergy mode
]
AVAILABLE_LIGHTS = [PhilipsApi.NEW2_DISPLAY_BACKLIGHT3]
AVAILABLE_SELECTS = [
Expand Down

0 comments on commit f10ea6a

Please sign in to comment.