mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +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_DOCKED,
|
||||||
STATE_ERROR,
|
STATE_ERROR,
|
||||||
STATE_PAUSED,
|
STATE_PAUSED,
|
||||||
SUPPORT_START,
|
|
||||||
SUPPORT_STATE,
|
|
||||||
SUPPORT_STATUS,
|
|
||||||
SUPPORT_TURN_OFF,
|
|
||||||
SUPPORT_TURN_ON,
|
|
||||||
StateVacuumEntity,
|
StateVacuumEntity,
|
||||||
|
VacuumEntityFeature,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import STATE_OFF
|
from homeassistant.const import STATE_OFF
|
||||||
@ -32,9 +28,6 @@ from .hub import LitterRobotHub
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
SUPPORT_LITTERROBOT = (
|
|
||||||
SUPPORT_START | SUPPORT_STATE | SUPPORT_STATUS | SUPPORT_TURN_OFF | SUPPORT_TURN_ON
|
|
||||||
)
|
|
||||||
TYPE_LITTER_BOX = "Litter Box"
|
TYPE_LITTER_BOX = "Litter Box"
|
||||||
|
|
||||||
SERVICE_RESET_WASTE_DRAWER = "reset_waste_drawer"
|
SERVICE_RESET_WASTE_DRAWER = "reset_waste_drawer"
|
||||||
@ -81,10 +74,18 @@ async def async_setup_entry(
|
|||||||
class LitterRobotCleaner(LitterRobotControlEntity, StateVacuumEntity):
|
class LitterRobotCleaner(LitterRobotControlEntity, StateVacuumEntity):
|
||||||
"""Litter-Robot "Vacuum" Cleaner."""
|
"""Litter-Robot "Vacuum" Cleaner."""
|
||||||
|
|
||||||
|
_attr_supported_features = (
|
||||||
|
VacuumEntityFeature.START
|
||||||
|
| VacuumEntityFeature.STATE
|
||||||
|
| VacuumEntityFeature.STATUS
|
||||||
|
| VacuumEntityFeature.TURN_OFF
|
||||||
|
| VacuumEntityFeature.TURN_ON
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_features(self) -> int:
|
def supported_features(self) -> int:
|
||||||
"""Flag cleaner robot features that are supported."""
|
"""Flag cleaner robot features that are supported."""
|
||||||
return SUPPORT_LITTERROBOT
|
return self._attr_supported_features
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> str:
|
def state(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user