Swap sharkiq vacuum is_docked with is_charging (#58975)

This commit is contained in:
Thomas G 2021-11-04 05:21:59 -05:00 committed by GitHub
parent 32784d1b83
commit 74beebc031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,11 +138,6 @@ class SharkVacuumEntity(CoordinatorEntity, StateVacuumEntity):
"""Flag vacuum cleaner robot features that are supported.""" """Flag vacuum cleaner robot features that are supported."""
return SUPPORT_SHARKIQ return SUPPORT_SHARKIQ
@property
def is_docked(self) -> bool | None:
"""Is vacuum docked."""
return self.sharkiq.get_property_value(Properties.DOCKED_STATUS)
@property @property
def error_code(self) -> int | None: def error_code(self) -> int | None:
"""Return the last observed error code (or None).""" """Return the last observed error code (or None)."""
@ -175,7 +170,7 @@ class SharkVacuumEntity(CoordinatorEntity, StateVacuumEntity):
In the app, these are (usually) handled by showing the robot as stopped and sending the In the app, these are (usually) handled by showing the robot as stopped and sending the
user a notification. user a notification.
""" """
if self.is_docked: if self.sharkiq.get_property_value(Properties.CHARGING_STATUS):
return STATE_DOCKED return STATE_DOCKED
return self.operating_mode return self.operating_mode