Add Roborock to strict typing (#120379)

This commit is contained in:
Luke Lashley 2024-06-26 08:13:49 -04:00 committed by GitHub
parent 0d2aeb846f
commit 69e0227682
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 8 deletions

View file

@ -167,9 +167,9 @@ class RoborockSwitch(RoborockEntity, SwitchEntity):
@property
def is_on(self) -> bool | None:
"""Return True if entity is on."""
return (
self.get_cache(self.entity_description.cache_key).value.get(
self.entity_description.attribute
)
== 1
status = self.get_cache(self.entity_description.cache_key).value.get(
self.entity_description.attribute
)
if status is None:
return status
return bool(status)