Skip to content

Commit

Permalink
Improve cleanup mode mapping for Roborock S6 (close dext0r#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
dext0r committed Apr 3, 2023
1 parent 02925c3 commit 39a979e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 7 additions & 4 deletions custom_components/yandex_smart_home/capability_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,15 +732,18 @@ class CleanupModeCapability(ModeCapability):

instance = const.MODE_INSTANCE_CLEANUP_MODE
modes_map_default = {
const.MODE_INSTANCE_MODE_AUTO: ['auto', 'automatic', '102'],
const.MODE_INSTANCE_MODE_TURBO: ['turbo', 'high', 'performance', '104', 'full speed', 'max+'],
const.MODE_INSTANCE_MODE_ECO: [const.CLEANUP_MODE_OFF],
const.MODE_INSTANCE_MODE_AUTO: ['auto', 'automatic', '102', const.CLEANUP_MODE_BALANCED],
const.MODE_INSTANCE_MODE_TURBO: [const.CLEANUP_MODE_TURBO, 'high', 'performance', '104', 'full speed', 'max+'],
const.MODE_INSTANCE_MODE_MIN: ['min', 'mop'],
const.MODE_INSTANCE_MODE_LOW: ['gentle'],
const.MODE_INSTANCE_MODE_MAX: ['max', 'strong'],
const.MODE_INSTANCE_MODE_MAX: [const.CLEANUP_MODE_MAX, 'strong'],
const.MODE_INSTANCE_MODE_FAST: [const.CLEANUP_MODE_MAX_PLUS],
const.MODE_INSTANCE_MODE_EXPRESS: ['express', '105'],
const.MODE_INSTANCE_MODE_MEDIUM: ['medium', 'middle'],
const.MODE_INSTANCE_MODE_NORMAL: ['normal', 'standard', 'basic', '103'],
const.MODE_INSTANCE_MODE_QUIET: ['quiet', 'low', 'min', 'silent', 'eco', '101'],
const.MODE_INSTANCE_MODE_QUIET: ['quiet', 'low', 'min', const.CLEANUP_MODE_SILENT, 'eco', '101'],
const.MODE_INSTANCE_MODE_SMART: [const.CLEANUP_MODE_MAX_PLUS],
}

def supported(self) -> bool:
Expand Down
8 changes: 8 additions & 0 deletions custom_components/yandex_smart_home/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@
# SmartIR
FAN_SPEED_HIGHEST = 'highest'

# https://github.com/humbertogontijo/python-roborock/blob/1616217a06e20d51921de984134555bcc0775a92/roborock/code_mappings.py#L61
CLEANUP_MODE_OFF = 'off'
CLEANUP_MODE_SILENT = 'silent'
CLEANUP_MODE_BALANCED = 'balanced'
CLEANUP_MODE_TURBO = 'turbo'
CLEANUP_MODE_MAX = 'max'
CLEANUP_MODE_MAX_PLUS = 'max_plus'
CLEANUP_MODE_CUSTOM = 'custom'

MEDIA_PLAYER_FEATURE_VOLUME_MUTE = 'volume_mute'
MEDIA_PLAYER_FEATURE_VOLUME_SET = 'volume_set'
Expand Down

0 comments on commit 39a979e

Please sign in to comment.