roborock.data.code_mappings
1from __future__ import annotations 2 3import logging 4from collections import namedtuple 5from enum import Enum, IntEnum, StrEnum 6from typing import Self 7 8_LOGGER = logging.getLogger(__name__) 9completed_warnings = set() 10 11 12class RoborockEnum(IntEnum): 13 """Roborock Enum for codes with int values""" 14 15 @property 16 def name(self) -> str: 17 return super().name.lower() 18 19 @classmethod 20 def _missing_(cls: type[RoborockEnum], key) -> RoborockEnum: 21 if hasattr(cls, "unknown"): 22 warning = f"Missing {cls.__name__} code: {key} - defaulting to 'unknown'" 23 if warning not in completed_warnings: 24 completed_warnings.add(warning) 25 _LOGGER.warning(warning) 26 return cls.unknown # type: ignore 27 default_value = next(item for item in cls) 28 warning = f"Missing {cls.__name__} code: {key} - defaulting to {default_value}" 29 if warning not in completed_warnings: 30 completed_warnings.add(warning) 31 _LOGGER.warning(warning) 32 return default_value 33 34 @classmethod 35 def as_dict(cls: type[RoborockEnum]): 36 return {i.name: i.value for i in cls if i.name != "missing"} 37 38 @classmethod 39 def as_enum_dict(cls: type[RoborockEnum]): 40 return {i.value: i for i in cls if i.name != "missing"} 41 42 @classmethod 43 def values(cls: type[RoborockEnum]) -> list[int]: 44 return list(cls.as_dict().values()) 45 46 @classmethod 47 def keys(cls: type[RoborockEnum]) -> list[str]: 48 return list(cls.as_dict().keys()) 49 50 @classmethod 51 def items(cls: type[RoborockEnum]): 52 return cls.as_dict().items() 53 54 55class RoborockModeEnum(StrEnum): 56 """A custom StrEnum that also stores an integer code for each member.""" 57 58 code: int 59 """The integer code associated with the enum member.""" 60 61 def __new__(cls, value: str, code: int) -> Self: 62 """Creates a new enum member.""" 63 member = str.__new__(cls, value) 64 member._value_ = value 65 member.code = code 66 return member 67 68 @classmethod 69 def from_code(cls, code: int) -> Self: 70 for member in cls: 71 if member.code == code: 72 return member 73 message = f"{code} is not a valid code for {cls.__name__}" 74 if message not in completed_warnings: 75 completed_warnings.add(message) 76 _LOGGER.warning(message) 77 raise ValueError(message) 78 79 @classmethod 80 def from_code_optional(cls, code: int) -> Self | None: 81 """Gracefully return None if the code does not exist.""" 82 try: 83 return cls.from_code(code) 84 except ValueError: 85 return None 86 87 @classmethod 88 def from_value(cls, value: str) -> Self: 89 """Find enum member by string value (case-insensitive).""" 90 for member in cls: 91 if member.value.lower() == value.lower(): 92 return member 93 raise ValueError(f"{value} is not a valid value for {cls.__name__}") 94 95 @classmethod 96 def from_name(cls, name: str) -> Self: 97 """Find enum member by name (case-insensitive).""" 98 for member in cls: 99 if member.name.lower() == name.lower(): 100 return member 101 raise ValueError(f"{name} is not a valid name for {cls.__name__}") 102 103 @classmethod 104 def keys(cls) -> list[str]: 105 """Returns a list of all member values.""" 106 return [member.value for member in cls] 107 108 109ProductInfo = namedtuple("ProductInfo", ["nickname", "short_models"]) 110 111 112class RoborockProductNickname(Enum): 113 # Coral Series 114 CORAL = ProductInfo(nickname="Coral", short_models=("a20", "a21")) 115 CORALPRO = ProductInfo(nickname="CoralPro", short_models=("a143", "a144")) 116 117 # Pearl Series 118 PEARL = ProductInfo(nickname="Pearl", short_models=("a74", "a75")) 119 PEARLC = ProductInfo(nickname="PearlC", short_models=("a103", "a104")) 120 PEARLE = ProductInfo(nickname="PearlE", short_models=("a167", "a168")) 121 PEARLELITE = ProductInfo(nickname="PearlELite", short_models=("a169", "a170")) 122 PEARLPLUS = ProductInfo(nickname="PearlPlus", short_models=("a86", "a87")) 123 PEARLPLUSS = ProductInfo(nickname="PearlPlusS", short_models=("a116", "a117", "a136")) 124 PEARLS = ProductInfo(nickname="PearlS", short_models=("a100", "a101")) 125 PEARLSLITE = ProductInfo(nickname="PearlSLite", short_models=("a122", "a123")) 126 127 # Ruby Series 128 RUBYPLUS = ProductInfo(nickname="RubyPlus", short_models=("t4", "s4")) 129 RUBYSC = ProductInfo(nickname="RubySC", short_models=("p5", "a08")) 130 RUBYSE = ProductInfo(nickname="RubySE", short_models=("a19",)) 131 RUBYSLITE = ProductInfo(nickname="RubySLite", short_models=("p6", "s5e", "a05")) 132 133 # Tanos Series 134 TANOS = ProductInfo(nickname="Tanos", short_models=("t6", "s6")) 135 TANOSE = ProductInfo(nickname="TanosE", short_models=("t7", "a11")) 136 TANOSS = ProductInfo(nickname="TanosS", short_models=("a14", "a15")) 137 TANOSSC = ProductInfo(nickname="TanosSC", short_models=("a39", "a40")) 138 TANOSSE = ProductInfo(nickname="TanosSE", short_models=("a33", "a34")) 139 TANOSSMAX = ProductInfo(nickname="TanosSMax", short_models=("a52",)) 140 TANOSSLITE = ProductInfo(nickname="TanosSLite", short_models=("a37", "a38")) 141 TANOSSPLUS = ProductInfo(nickname="TanosSPlus", short_models=("a23", "a24")) 142 TANOSV = ProductInfo(nickname="TanosV", short_models=("t7p", "a09", "a10")) 143 144 # Topaz Series 145 TOPAZS = ProductInfo(nickname="TopazS", short_models=("a29", "a30", "a76")) 146 TOPAZSC = ProductInfo(nickname="TopazSC", short_models=("a64", "a65")) 147 TOPAZSPLUS = ProductInfo(nickname="TopazSPlus", short_models=("a46", "a47", "a66")) 148 TOPAZSPOWER = ProductInfo(nickname="TopazSPower", short_models=("a62",)) 149 TOPAZSV = ProductInfo(nickname="TopazSV", short_models=("a26", "a27")) 150 151 # Ultron Series 152 ULTRON = ProductInfo(nickname="Ultron", short_models=("a50", "a51")) 153 ULTRONE = ProductInfo(nickname="UltronE", short_models=("a72", "a84")) 154 ULTRONLITE = ProductInfo(nickname="UltronLite", short_models=("a73", "a85")) 155 ULTRONSC = ProductInfo(nickname="UltronSC", short_models=("a94", "a95")) 156 ULTRONSE = ProductInfo(nickname="UltronSE", short_models=("a124", "a125", "a139", "a140")) 157 ULTRONSPLUS = ProductInfo(nickname="UltronSPlus", short_models=("a68", "a69", "a70")) 158 ULTRONSV = ProductInfo(nickname="UltronSV", short_models=("a96", "a97")) 159 160 # Verdelite Series 161 VERDELITE = ProductInfo(nickname="Verdelite", short_models=("a146", "a147")) 162 163 # Vivian Series 164 VIVIAN = ProductInfo(nickname="Vivian", short_models=("a134", "a135", "a155", "a156")) 165 VIVIANC = ProductInfo(nickname="VivianC", short_models=("a158", "a159")) 166 167 168SHORT_MODEL_TO_ENUM = {model: product for product in RoborockProductNickname for model in product.value.short_models} 169 170 171class RoborockCategory(Enum): 172 """Describes the category of the device.""" 173 174 WET_DRY_VAC = "roborock.wetdryvac" 175 VACUUM = "robot.vacuum.cleaner" 176 WASHING_MACHINE = "roborock.wm" 177 MOWER = "roborock.mower" 178 UNKNOWN = "UNKNOWN" 179 180 @classmethod 181 def _missing_(cls, value): 182 _LOGGER.warning("Missing code %s from category", value) 183 return RoborockCategory.UNKNOWN
completed_warnings =
set()
class
RoborockEnum(enum.IntEnum):
13class RoborockEnum(IntEnum): 14 """Roborock Enum for codes with int values""" 15 16 @property 17 def name(self) -> str: 18 return super().name.lower() 19 20 @classmethod 21 def _missing_(cls: type[RoborockEnum], key) -> RoborockEnum: 22 if hasattr(cls, "unknown"): 23 warning = f"Missing {cls.__name__} code: {key} - defaulting to 'unknown'" 24 if warning not in completed_warnings: 25 completed_warnings.add(warning) 26 _LOGGER.warning(warning) 27 return cls.unknown # type: ignore 28 default_value = next(item for item in cls) 29 warning = f"Missing {cls.__name__} code: {key} - defaulting to {default_value}" 30 if warning not in completed_warnings: 31 completed_warnings.add(warning) 32 _LOGGER.warning(warning) 33 return default_value 34 35 @classmethod 36 def as_dict(cls: type[RoborockEnum]): 37 return {i.name: i.value for i in cls if i.name != "missing"} 38 39 @classmethod 40 def as_enum_dict(cls: type[RoborockEnum]): 41 return {i.value: i for i in cls if i.name != "missing"} 42 43 @classmethod 44 def values(cls: type[RoborockEnum]) -> list[int]: 45 return list(cls.as_dict().values()) 46 47 @classmethod 48 def keys(cls: type[RoborockEnum]) -> list[str]: 49 return list(cls.as_dict().keys()) 50 51 @classmethod 52 def items(cls: type[RoborockEnum]): 53 return cls.as_dict().items()
Roborock Enum for codes with int values
class
RoborockModeEnum(enum.StrEnum):
56class RoborockModeEnum(StrEnum): 57 """A custom StrEnum that also stores an integer code for each member.""" 58 59 code: int 60 """The integer code associated with the enum member.""" 61 62 def __new__(cls, value: str, code: int) -> Self: 63 """Creates a new enum member.""" 64 member = str.__new__(cls, value) 65 member._value_ = value 66 member.code = code 67 return member 68 69 @classmethod 70 def from_code(cls, code: int) -> Self: 71 for member in cls: 72 if member.code == code: 73 return member 74 message = f"{code} is not a valid code for {cls.__name__}" 75 if message not in completed_warnings: 76 completed_warnings.add(message) 77 _LOGGER.warning(message) 78 raise ValueError(message) 79 80 @classmethod 81 def from_code_optional(cls, code: int) -> Self | None: 82 """Gracefully return None if the code does not exist.""" 83 try: 84 return cls.from_code(code) 85 except ValueError: 86 return None 87 88 @classmethod 89 def from_value(cls, value: str) -> Self: 90 """Find enum member by string value (case-insensitive).""" 91 for member in cls: 92 if member.value.lower() == value.lower(): 93 return member 94 raise ValueError(f"{value} is not a valid value for {cls.__name__}") 95 96 @classmethod 97 def from_name(cls, name: str) -> Self: 98 """Find enum member by name (case-insensitive).""" 99 for member in cls: 100 if member.name.lower() == name.lower(): 101 return member 102 raise ValueError(f"{name} is not a valid name for {cls.__name__}") 103 104 @classmethod 105 def keys(cls) -> list[str]: 106 """Returns a list of all member values.""" 107 return [member.value for member in cls]
A custom StrEnum that also stores an integer code for each member.
@classmethod
def
from_code(cls, code: int) -> Self:
69 @classmethod 70 def from_code(cls, code: int) -> Self: 71 for member in cls: 72 if member.code == code: 73 return member 74 message = f"{code} is not a valid code for {cls.__name__}" 75 if message not in completed_warnings: 76 completed_warnings.add(message) 77 _LOGGER.warning(message) 78 raise ValueError(message)
@classmethod
def
from_code_optional(cls, code: int) -> Optional[Self]:
80 @classmethod 81 def from_code_optional(cls, code: int) -> Self | None: 82 """Gracefully return None if the code does not exist.""" 83 try: 84 return cls.from_code(code) 85 except ValueError: 86 return None
Gracefully return None if the code does not exist.
@classmethod
def
from_value(cls, value: str) -> Self:
88 @classmethod 89 def from_value(cls, value: str) -> Self: 90 """Find enum member by string value (case-insensitive).""" 91 for member in cls: 92 if member.value.lower() == value.lower(): 93 return member 94 raise ValueError(f"{value} is not a valid value for {cls.__name__}")
Find enum member by string value (case-insensitive).
@classmethod
def
from_name(cls, name: str) -> Self:
96 @classmethod 97 def from_name(cls, name: str) -> Self: 98 """Find enum member by name (case-insensitive).""" 99 for member in cls: 100 if member.name.lower() == name.lower(): 101 return member 102 raise ValueError(f"{name} is not a valid name for {cls.__name__}")
Find enum member by name (case-insensitive).
class
ProductInfo(builtins.tuple):
ProductInfo(nickname, short_models)
class
RoborockProductNickname(enum.Enum):
113class RoborockProductNickname(Enum): 114 # Coral Series 115 CORAL = ProductInfo(nickname="Coral", short_models=("a20", "a21")) 116 CORALPRO = ProductInfo(nickname="CoralPro", short_models=("a143", "a144")) 117 118 # Pearl Series 119 PEARL = ProductInfo(nickname="Pearl", short_models=("a74", "a75")) 120 PEARLC = ProductInfo(nickname="PearlC", short_models=("a103", "a104")) 121 PEARLE = ProductInfo(nickname="PearlE", short_models=("a167", "a168")) 122 PEARLELITE = ProductInfo(nickname="PearlELite", short_models=("a169", "a170")) 123 PEARLPLUS = ProductInfo(nickname="PearlPlus", short_models=("a86", "a87")) 124 PEARLPLUSS = ProductInfo(nickname="PearlPlusS", short_models=("a116", "a117", "a136")) 125 PEARLS = ProductInfo(nickname="PearlS", short_models=("a100", "a101")) 126 PEARLSLITE = ProductInfo(nickname="PearlSLite", short_models=("a122", "a123")) 127 128 # Ruby Series 129 RUBYPLUS = ProductInfo(nickname="RubyPlus", short_models=("t4", "s4")) 130 RUBYSC = ProductInfo(nickname="RubySC", short_models=("p5", "a08")) 131 RUBYSE = ProductInfo(nickname="RubySE", short_models=("a19",)) 132 RUBYSLITE = ProductInfo(nickname="RubySLite", short_models=("p6", "s5e", "a05")) 133 134 # Tanos Series 135 TANOS = ProductInfo(nickname="Tanos", short_models=("t6", "s6")) 136 TANOSE = ProductInfo(nickname="TanosE", short_models=("t7", "a11")) 137 TANOSS = ProductInfo(nickname="TanosS", short_models=("a14", "a15")) 138 TANOSSC = ProductInfo(nickname="TanosSC", short_models=("a39", "a40")) 139 TANOSSE = ProductInfo(nickname="TanosSE", short_models=("a33", "a34")) 140 TANOSSMAX = ProductInfo(nickname="TanosSMax", short_models=("a52",)) 141 TANOSSLITE = ProductInfo(nickname="TanosSLite", short_models=("a37", "a38")) 142 TANOSSPLUS = ProductInfo(nickname="TanosSPlus", short_models=("a23", "a24")) 143 TANOSV = ProductInfo(nickname="TanosV", short_models=("t7p", "a09", "a10")) 144 145 # Topaz Series 146 TOPAZS = ProductInfo(nickname="TopazS", short_models=("a29", "a30", "a76")) 147 TOPAZSC = ProductInfo(nickname="TopazSC", short_models=("a64", "a65")) 148 TOPAZSPLUS = ProductInfo(nickname="TopazSPlus", short_models=("a46", "a47", "a66")) 149 TOPAZSPOWER = ProductInfo(nickname="TopazSPower", short_models=("a62",)) 150 TOPAZSV = ProductInfo(nickname="TopazSV", short_models=("a26", "a27")) 151 152 # Ultron Series 153 ULTRON = ProductInfo(nickname="Ultron", short_models=("a50", "a51")) 154 ULTRONE = ProductInfo(nickname="UltronE", short_models=("a72", "a84")) 155 ULTRONLITE = ProductInfo(nickname="UltronLite", short_models=("a73", "a85")) 156 ULTRONSC = ProductInfo(nickname="UltronSC", short_models=("a94", "a95")) 157 ULTRONSE = ProductInfo(nickname="UltronSE", short_models=("a124", "a125", "a139", "a140")) 158 ULTRONSPLUS = ProductInfo(nickname="UltronSPlus", short_models=("a68", "a69", "a70")) 159 ULTRONSV = ProductInfo(nickname="UltronSV", short_models=("a96", "a97")) 160 161 # Verdelite Series 162 VERDELITE = ProductInfo(nickname="Verdelite", short_models=("a146", "a147")) 163 164 # Vivian Series 165 VIVIAN = ProductInfo(nickname="Vivian", short_models=("a134", "a135", "a155", "a156")) 166 VIVIANC = ProductInfo(nickname="VivianC", short_models=("a158", "a159"))
CORAL =
<RoborockProductNickname.CORAL: ProductInfo(nickname='Coral', short_models=('a20', 'a21'))>
CORALPRO =
<RoborockProductNickname.CORALPRO: ProductInfo(nickname='CoralPro', short_models=('a143', 'a144'))>
PEARL =
<RoborockProductNickname.PEARL: ProductInfo(nickname='Pearl', short_models=('a74', 'a75'))>
PEARLC =
<RoborockProductNickname.PEARLC: ProductInfo(nickname='PearlC', short_models=('a103', 'a104'))>
PEARLE =
<RoborockProductNickname.PEARLE: ProductInfo(nickname='PearlE', short_models=('a167', 'a168'))>
PEARLELITE =
<RoborockProductNickname.PEARLELITE: ProductInfo(nickname='PearlELite', short_models=('a169', 'a170'))>
PEARLPLUS =
<RoborockProductNickname.PEARLPLUS: ProductInfo(nickname='PearlPlus', short_models=('a86', 'a87'))>
PEARLPLUSS =
<RoborockProductNickname.PEARLPLUSS: ProductInfo(nickname='PearlPlusS', short_models=('a116', 'a117', 'a136'))>
PEARLS =
<RoborockProductNickname.PEARLS: ProductInfo(nickname='PearlS', short_models=('a100', 'a101'))>
PEARLSLITE =
<RoborockProductNickname.PEARLSLITE: ProductInfo(nickname='PearlSLite', short_models=('a122', 'a123'))>
RUBYPLUS =
<RoborockProductNickname.RUBYPLUS: ProductInfo(nickname='RubyPlus', short_models=('t4', 's4'))>
RUBYSC =
<RoborockProductNickname.RUBYSC: ProductInfo(nickname='RubySC', short_models=('p5', 'a08'))>
RUBYSE =
<RoborockProductNickname.RUBYSE: ProductInfo(nickname='RubySE', short_models=('a19',))>
RUBYSLITE =
<RoborockProductNickname.RUBYSLITE: ProductInfo(nickname='RubySLite', short_models=('p6', 's5e', 'a05'))>
TANOS =
<RoborockProductNickname.TANOS: ProductInfo(nickname='Tanos', short_models=('t6', 's6'))>
TANOSE =
<RoborockProductNickname.TANOSE: ProductInfo(nickname='TanosE', short_models=('t7', 'a11'))>
TANOSS =
<RoborockProductNickname.TANOSS: ProductInfo(nickname='TanosS', short_models=('a14', 'a15'))>
TANOSSC =
<RoborockProductNickname.TANOSSC: ProductInfo(nickname='TanosSC', short_models=('a39', 'a40'))>
TANOSSE =
<RoborockProductNickname.TANOSSE: ProductInfo(nickname='TanosSE', short_models=('a33', 'a34'))>
TANOSSMAX =
<RoborockProductNickname.TANOSSMAX: ProductInfo(nickname='TanosSMax', short_models=('a52',))>
TANOSSLITE =
<RoborockProductNickname.TANOSSLITE: ProductInfo(nickname='TanosSLite', short_models=('a37', 'a38'))>
TANOSSPLUS =
<RoborockProductNickname.TANOSSPLUS: ProductInfo(nickname='TanosSPlus', short_models=('a23', 'a24'))>
TANOSV =
<RoborockProductNickname.TANOSV: ProductInfo(nickname='TanosV', short_models=('t7p', 'a09', 'a10'))>
TOPAZS =
<RoborockProductNickname.TOPAZS: ProductInfo(nickname='TopazS', short_models=('a29', 'a30', 'a76'))>
TOPAZSC =
<RoborockProductNickname.TOPAZSC: ProductInfo(nickname='TopazSC', short_models=('a64', 'a65'))>
TOPAZSPLUS =
<RoborockProductNickname.TOPAZSPLUS: ProductInfo(nickname='TopazSPlus', short_models=('a46', 'a47', 'a66'))>
TOPAZSPOWER =
<RoborockProductNickname.TOPAZSPOWER: ProductInfo(nickname='TopazSPower', short_models=('a62',))>
TOPAZSV =
<RoborockProductNickname.TOPAZSV: ProductInfo(nickname='TopazSV', short_models=('a26', 'a27'))>
ULTRON =
<RoborockProductNickname.ULTRON: ProductInfo(nickname='Ultron', short_models=('a50', 'a51'))>
ULTRONE =
<RoborockProductNickname.ULTRONE: ProductInfo(nickname='UltronE', short_models=('a72', 'a84'))>
ULTRONLITE =
<RoborockProductNickname.ULTRONLITE: ProductInfo(nickname='UltronLite', short_models=('a73', 'a85'))>
ULTRONSC =
<RoborockProductNickname.ULTRONSC: ProductInfo(nickname='UltronSC', short_models=('a94', 'a95'))>
ULTRONSE =
<RoborockProductNickname.ULTRONSE: ProductInfo(nickname='UltronSE', short_models=('a124', 'a125', 'a139', 'a140'))>
ULTRONSPLUS =
<RoborockProductNickname.ULTRONSPLUS: ProductInfo(nickname='UltronSPlus', short_models=('a68', 'a69', 'a70'))>
ULTRONSV =
<RoborockProductNickname.ULTRONSV: ProductInfo(nickname='UltronSV', short_models=('a96', 'a97'))>
VERDELITE =
<RoborockProductNickname.VERDELITE: ProductInfo(nickname='Verdelite', short_models=('a146', 'a147'))>
VIVIAN =
<RoborockProductNickname.VIVIAN: ProductInfo(nickname='Vivian', short_models=('a134', 'a135', 'a155', 'a156'))>
VIVIANC =
<RoborockProductNickname.VIVIANC: ProductInfo(nickname='VivianC', short_models=('a158', 'a159'))>
SHORT_MODEL_TO_ENUM =
{'a20': <RoborockProductNickname.CORAL: ProductInfo(nickname='Coral', short_models=('a20', 'a21'))>, 'a21': <RoborockProductNickname.CORAL: ProductInfo(nickname='Coral', short_models=('a20', 'a21'))>, 'a143': <RoborockProductNickname.CORALPRO: ProductInfo(nickname='CoralPro', short_models=('a143', 'a144'))>, 'a144': <RoborockProductNickname.CORALPRO: ProductInfo(nickname='CoralPro', short_models=('a143', 'a144'))>, 'a74': <RoborockProductNickname.PEARL: ProductInfo(nickname='Pearl', short_models=('a74', 'a75'))>, 'a75': <RoborockProductNickname.PEARL: ProductInfo(nickname='Pearl', short_models=('a74', 'a75'))>, 'a103': <RoborockProductNickname.PEARLC: ProductInfo(nickname='PearlC', short_models=('a103', 'a104'))>, 'a104': <RoborockProductNickname.PEARLC: ProductInfo(nickname='PearlC', short_models=('a103', 'a104'))>, 'a167': <RoborockProductNickname.PEARLE: ProductInfo(nickname='PearlE', short_models=('a167', 'a168'))>, 'a168': <RoborockProductNickname.PEARLE: ProductInfo(nickname='PearlE', short_models=('a167', 'a168'))>, 'a169': <RoborockProductNickname.PEARLELITE: ProductInfo(nickname='PearlELite', short_models=('a169', 'a170'))>, 'a170': <RoborockProductNickname.PEARLELITE: ProductInfo(nickname='PearlELite', short_models=('a169', 'a170'))>, 'a86': <RoborockProductNickname.PEARLPLUS: ProductInfo(nickname='PearlPlus', short_models=('a86', 'a87'))>, 'a87': <RoborockProductNickname.PEARLPLUS: ProductInfo(nickname='PearlPlus', short_models=('a86', 'a87'))>, 'a116': <RoborockProductNickname.PEARLPLUSS: ProductInfo(nickname='PearlPlusS', short_models=('a116', 'a117', 'a136'))>, 'a117': <RoborockProductNickname.PEARLPLUSS: ProductInfo(nickname='PearlPlusS', short_models=('a116', 'a117', 'a136'))>, 'a136': <RoborockProductNickname.PEARLPLUSS: ProductInfo(nickname='PearlPlusS', short_models=('a116', 'a117', 'a136'))>, 'a100': <RoborockProductNickname.PEARLS: ProductInfo(nickname='PearlS', short_models=('a100', 'a101'))>, 'a101': <RoborockProductNickname.PEARLS: ProductInfo(nickname='PearlS', short_models=('a100', 'a101'))>, 'a122': <RoborockProductNickname.PEARLSLITE: ProductInfo(nickname='PearlSLite', short_models=('a122', 'a123'))>, 'a123': <RoborockProductNickname.PEARLSLITE: ProductInfo(nickname='PearlSLite', short_models=('a122', 'a123'))>, 't4': <RoborockProductNickname.RUBYPLUS: ProductInfo(nickname='RubyPlus', short_models=('t4', 's4'))>, 's4': <RoborockProductNickname.RUBYPLUS: ProductInfo(nickname='RubyPlus', short_models=('t4', 's4'))>, 'p5': <RoborockProductNickname.RUBYSC: ProductInfo(nickname='RubySC', short_models=('p5', 'a08'))>, 'a08': <RoborockProductNickname.RUBYSC: ProductInfo(nickname='RubySC', short_models=('p5', 'a08'))>, 'a19': <RoborockProductNickname.RUBYSE: ProductInfo(nickname='RubySE', short_models=('a19',))>, 'p6': <RoborockProductNickname.RUBYSLITE: ProductInfo(nickname='RubySLite', short_models=('p6', 's5e', 'a05'))>, 's5e': <RoborockProductNickname.RUBYSLITE: ProductInfo(nickname='RubySLite', short_models=('p6', 's5e', 'a05'))>, 'a05': <RoborockProductNickname.RUBYSLITE: ProductInfo(nickname='RubySLite', short_models=('p6', 's5e', 'a05'))>, 't6': <RoborockProductNickname.TANOS: ProductInfo(nickname='Tanos', short_models=('t6', 's6'))>, 's6': <RoborockProductNickname.TANOS: ProductInfo(nickname='Tanos', short_models=('t6', 's6'))>, 't7': <RoborockProductNickname.TANOSE: ProductInfo(nickname='TanosE', short_models=('t7', 'a11'))>, 'a11': <RoborockProductNickname.TANOSE: ProductInfo(nickname='TanosE', short_models=('t7', 'a11'))>, 'a14': <RoborockProductNickname.TANOSS: ProductInfo(nickname='TanosS', short_models=('a14', 'a15'))>, 'a15': <RoborockProductNickname.TANOSS: ProductInfo(nickname='TanosS', short_models=('a14', 'a15'))>, 'a39': <RoborockProductNickname.TANOSSC: ProductInfo(nickname='TanosSC', short_models=('a39', 'a40'))>, 'a40': <RoborockProductNickname.TANOSSC: ProductInfo(nickname='TanosSC', short_models=('a39', 'a40'))>, 'a33': <RoborockProductNickname.TANOSSE: ProductInfo(nickname='TanosSE', short_models=('a33', 'a34'))>, 'a34': <RoborockProductNickname.TANOSSE: ProductInfo(nickname='TanosSE', short_models=('a33', 'a34'))>, 'a52': <RoborockProductNickname.TANOSSMAX: ProductInfo(nickname='TanosSMax', short_models=('a52',))>, 'a37': <RoborockProductNickname.TANOSSLITE: ProductInfo(nickname='TanosSLite', short_models=('a37', 'a38'))>, 'a38': <RoborockProductNickname.TANOSSLITE: ProductInfo(nickname='TanosSLite', short_models=('a37', 'a38'))>, 'a23': <RoborockProductNickname.TANOSSPLUS: ProductInfo(nickname='TanosSPlus', short_models=('a23', 'a24'))>, 'a24': <RoborockProductNickname.TANOSSPLUS: ProductInfo(nickname='TanosSPlus', short_models=('a23', 'a24'))>, 't7p': <RoborockProductNickname.TANOSV: ProductInfo(nickname='TanosV', short_models=('t7p', 'a09', 'a10'))>, 'a09': <RoborockProductNickname.TANOSV: ProductInfo(nickname='TanosV', short_models=('t7p', 'a09', 'a10'))>, 'a10': <RoborockProductNickname.TANOSV: ProductInfo(nickname='TanosV', short_models=('t7p', 'a09', 'a10'))>, 'a29': <RoborockProductNickname.TOPAZS: ProductInfo(nickname='TopazS', short_models=('a29', 'a30', 'a76'))>, 'a30': <RoborockProductNickname.TOPAZS: ProductInfo(nickname='TopazS', short_models=('a29', 'a30', 'a76'))>, 'a76': <RoborockProductNickname.TOPAZS: ProductInfo(nickname='TopazS', short_models=('a29', 'a30', 'a76'))>, 'a64': <RoborockProductNickname.TOPAZSC: ProductInfo(nickname='TopazSC', short_models=('a64', 'a65'))>, 'a65': <RoborockProductNickname.TOPAZSC: ProductInfo(nickname='TopazSC', short_models=('a64', 'a65'))>, 'a46': <RoborockProductNickname.TOPAZSPLUS: ProductInfo(nickname='TopazSPlus', short_models=('a46', 'a47', 'a66'))>, 'a47': <RoborockProductNickname.TOPAZSPLUS: ProductInfo(nickname='TopazSPlus', short_models=('a46', 'a47', 'a66'))>, 'a66': <RoborockProductNickname.TOPAZSPLUS: ProductInfo(nickname='TopazSPlus', short_models=('a46', 'a47', 'a66'))>, 'a62': <RoborockProductNickname.TOPAZSPOWER: ProductInfo(nickname='TopazSPower', short_models=('a62',))>, 'a26': <RoborockProductNickname.TOPAZSV: ProductInfo(nickname='TopazSV', short_models=('a26', 'a27'))>, 'a27': <RoborockProductNickname.TOPAZSV: ProductInfo(nickname='TopazSV', short_models=('a26', 'a27'))>, 'a50': <RoborockProductNickname.ULTRON: ProductInfo(nickname='Ultron', short_models=('a50', 'a51'))>, 'a51': <RoborockProductNickname.ULTRON: ProductInfo(nickname='Ultron', short_models=('a50', 'a51'))>, 'a72': <RoborockProductNickname.ULTRONE: ProductInfo(nickname='UltronE', short_models=('a72', 'a84'))>, 'a84': <RoborockProductNickname.ULTRONE: ProductInfo(nickname='UltronE', short_models=('a72', 'a84'))>, 'a73': <RoborockProductNickname.ULTRONLITE: ProductInfo(nickname='UltronLite', short_models=('a73', 'a85'))>, 'a85': <RoborockProductNickname.ULTRONLITE: ProductInfo(nickname='UltronLite', short_models=('a73', 'a85'))>, 'a94': <RoborockProductNickname.ULTRONSC: ProductInfo(nickname='UltronSC', short_models=('a94', 'a95'))>, 'a95': <RoborockProductNickname.ULTRONSC: ProductInfo(nickname='UltronSC', short_models=('a94', 'a95'))>, 'a124': <RoborockProductNickname.ULTRONSE: ProductInfo(nickname='UltronSE', short_models=('a124', 'a125', 'a139', 'a140'))>, 'a125': <RoborockProductNickname.ULTRONSE: ProductInfo(nickname='UltronSE', short_models=('a124', 'a125', 'a139', 'a140'))>, 'a139': <RoborockProductNickname.ULTRONSE: ProductInfo(nickname='UltronSE', short_models=('a124', 'a125', 'a139', 'a140'))>, 'a140': <RoborockProductNickname.ULTRONSE: ProductInfo(nickname='UltronSE', short_models=('a124', 'a125', 'a139', 'a140'))>, 'a68': <RoborockProductNickname.ULTRONSPLUS: ProductInfo(nickname='UltronSPlus', short_models=('a68', 'a69', 'a70'))>, 'a69': <RoborockProductNickname.ULTRONSPLUS: ProductInfo(nickname='UltronSPlus', short_models=('a68', 'a69', 'a70'))>, 'a70': <RoborockProductNickname.ULTRONSPLUS: ProductInfo(nickname='UltronSPlus', short_models=('a68', 'a69', 'a70'))>, 'a96': <RoborockProductNickname.ULTRONSV: ProductInfo(nickname='UltronSV', short_models=('a96', 'a97'))>, 'a97': <RoborockProductNickname.ULTRONSV: ProductInfo(nickname='UltronSV', short_models=('a96', 'a97'))>, 'a146': <RoborockProductNickname.VERDELITE: ProductInfo(nickname='Verdelite', short_models=('a146', 'a147'))>, 'a147': <RoborockProductNickname.VERDELITE: ProductInfo(nickname='Verdelite', short_models=('a146', 'a147'))>, 'a134': <RoborockProductNickname.VIVIAN: ProductInfo(nickname='Vivian', short_models=('a134', 'a135', 'a155', 'a156'))>, 'a135': <RoborockProductNickname.VIVIAN: ProductInfo(nickname='Vivian', short_models=('a134', 'a135', 'a155', 'a156'))>, 'a155': <RoborockProductNickname.VIVIAN: ProductInfo(nickname='Vivian', short_models=('a134', 'a135', 'a155', 'a156'))>, 'a156': <RoborockProductNickname.VIVIAN: ProductInfo(nickname='Vivian', short_models=('a134', 'a135', 'a155', 'a156'))>, 'a158': <RoborockProductNickname.VIVIANC: ProductInfo(nickname='VivianC', short_models=('a158', 'a159'))>, 'a159': <RoborockProductNickname.VIVIANC: ProductInfo(nickname='VivianC', short_models=('a158', 'a159'))>}
class
RoborockCategory(enum.Enum):
172class RoborockCategory(Enum): 173 """Describes the category of the device.""" 174 175 WET_DRY_VAC = "roborock.wetdryvac" 176 VACUUM = "robot.vacuum.cleaner" 177 WASHING_MACHINE = "roborock.wm" 178 MOWER = "roborock.mower" 179 UNKNOWN = "UNKNOWN" 180 181 @classmethod 182 def _missing_(cls, value): 183 _LOGGER.warning("Missing code %s from category", value) 184 return RoborockCategory.UNKNOWN
Describes the category of the device.
WET_DRY_VAC =
<RoborockCategory.WET_DRY_VAC: 'roborock.wetdryvac'>
VACUUM =
<RoborockCategory.VACUUM: 'robot.vacuum.cleaner'>
WASHING_MACHINE =
<RoborockCategory.WASHING_MACHINE: 'roborock.wm'>
MOWER =
<RoborockCategory.MOWER: 'roborock.mower'>
UNKNOWN =
<RoborockCategory.UNKNOWN: 'UNKNOWN'>