fix: Fix the HA warning in the logs related to vacuum state setting

Adapt to new vacuum state property, set the activity property instead of directly setting the state property.
This commit is contained in:
tedwang
2025-01-23 10:09:15 +08:00
parent 085caff660
commit 13e6863678
2 changed files with 47 additions and 3 deletions

View File

@ -213,6 +213,12 @@ class MIoTSpecValueList:
return item.description
return None
def get_name_by_value(self, value: Any) -> Optional[str]:
for item in self.items:
if item.value == value:
return item.name
return None
def dump(self) -> list:
return [item.dump() for item in self.items]