mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use VacuumEntityFeature in litterrobot (#70562)
This commit is contained in:
parent
c1888ce559
commit
acc5c7ddf0
@ -13,12 +13,8 @@ from homeassistant.components.vacuum import (
|
||||
STATE_DOCKED,
|
||||
STATE_ERROR,
|
||||
STATE_PAUSED,
|
||||
SUPPORT_START,
|
||||
SUPPORT_STATE,
|
||||
SUPPORT_STATUS,
|
||||
SUPPORT_TURN_OFF,
|
||||
SUPPORT_TURN_ON,
|
||||
StateVacuumEntity,
|
||||
VacuumEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import STATE_OFF
|
||||
@ -32,9 +28,6 @@ from .hub import LitterRobotHub
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORT_LITTERROBOT = (
|
||||
SUPPORT_START | SUPPORT_STATE | SUPPORT_STATUS | SUPPORT_TURN_OFF | SUPPORT_TURN_ON
|
||||
)
|
||||
TYPE_LITTER_BOX = "Litter Box"
|
||||
|
||||
SERVICE_RESET_WASTE_DRAWER = "reset_waste_drawer"
|
||||
@ -81,10 +74,18 @@ async def async_setup_entry(
|
||||
class LitterRobotCleaner(LitterRobotControlEntity, StateVacuumEntity):
|
||||
"""Litter-Robot "Vacuum" Cleaner."""
|
||||
|
||||
_attr_supported_features = (
|
||||
VacuumEntityFeature.START
|
||||
| VacuumEntityFeature.STATE
|
||||
| VacuumEntityFeature.STATUS
|
||||
| VacuumEntityFeature.TURN_OFF
|
||||
| VacuumEntityFeature.TURN_ON
|
||||
)
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag cleaner robot features that are supported."""
|
||||
return SUPPORT_LITTERROBOT
|
||||
return self._attr_supported_features
|
||||
|
||||
@property
|
||||
def state(self) -> str:
|
||||
|
Loading…
x
Reference in New Issue
Block a user