1- from __future__ import annotations
2-
31import logging
42from collections import namedtuple
53from enum import Enum , IntEnum , StrEnum
@@ -17,7 +15,7 @@ def name(self) -> str:
1715 return super ().name .lower ()
1816
1917 @classmethod
20- def _missing_ (cls : type [RoborockEnum ], key ) -> RoborockEnum :
18+ def _missing_ (cls : type [Self ], key ) -> Self :
2119 if hasattr (cls , "unknown" ):
2220 warning = f"Missing { cls .__name__ } code: { key } - defaulting to 'unknown'"
2321 if warning not in completed_warnings :
@@ -32,23 +30,23 @@ def _missing_(cls: type[RoborockEnum], key) -> RoborockEnum:
3230 return default_value
3331
3432 @classmethod
35- def as_dict (cls : type [RoborockEnum ]):
33+ def as_dict (cls : type [Self ]):
3634 return {i .name : i .value for i in cls if i .name != "missing" }
3735
3836 @classmethod
39- def as_enum_dict (cls : type [RoborockEnum ]):
37+ def as_enum_dict (cls : type [Self ]):
4038 return {i .value : i for i in cls if i .name != "missing" }
4139
4240 @classmethod
43- def values (cls : type [RoborockEnum ]) -> list [int ]:
41+ def values (cls : type [Self ]) -> list [int ]:
4442 return list (cls .as_dict ().values ())
4543
4644 @classmethod
47- def keys (cls : type [RoborockEnum ]) -> list [str ]:
45+ def keys (cls : type [Self ]) -> list [str ]:
4846 return list (cls .as_dict ().keys ())
4947
5048 @classmethod
51- def items (cls : type [RoborockEnum ]):
49+ def items (cls : type [Self ]):
5250 return cls .as_dict ().items ()
5351
5452
0 commit comments