Code cleanup in litterrobot (#86037)
This commit is contained in:
parent
5fbc005224
commit
c6f60bf45d
8 changed files with 23 additions and 67 deletions
|
@ -8,18 +8,14 @@ from typing import Any, Generic
|
|||
|
||||
from pylitterbot import FeederRobot, LitterRobot3
|
||||
|
||||
from homeassistant.components.button import (
|
||||
DOMAIN as PLATFORM,
|
||||
ButtonEntity,
|
||||
ButtonEntityDescription,
|
||||
)
|
||||
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN
|
||||
from .entity import LitterRobotEntity, _RobotT, async_update_unique_id
|
||||
from .entity import LitterRobotEntity, _RobotT
|
||||
from .hub import LitterRobotHub
|
||||
|
||||
|
||||
|
@ -47,7 +43,6 @@ async def async_setup_entry(
|
|||
),
|
||||
)
|
||||
)
|
||||
async_update_unique_id(hass, PLATFORM, entities)
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
|
@ -65,7 +60,7 @@ class RobotButtonEntityDescription(ButtonEntityDescription, RequiredKeysMixin[_R
|
|||
|
||||
LITTER_ROBOT_BUTTON = RobotButtonEntityDescription[LitterRobot3](
|
||||
key="reset_waste_drawer",
|
||||
name="Reset Waste Drawer",
|
||||
name="Reset waste drawer",
|
||||
icon="mdi:delete-variant",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
press_fn=lambda robot: robot.reset_waste_drawer(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue