Code cleanup in litterrobot (#86037)
This commit is contained in:
parent
5fbc005224
commit
c6f60bf45d
8 changed files with 23 additions and 67 deletions
|
@ -8,11 +8,7 @@ from typing import Any, Generic, TypeVar
|
|||
|
||||
from pylitterbot import FeederRobot, LitterRobot
|
||||
|
||||
from homeassistant.components.select import (
|
||||
DOMAIN as PLATFORM,
|
||||
SelectEntity,
|
||||
SelectEntityDescription,
|
||||
)
|
||||
from homeassistant.components.select import SelectEntity, SelectEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import UnitOfTime
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -20,7 +16,7 @@ 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
|
||||
|
||||
_CastTypeT = TypeVar("_CastTypeT", int, float)
|
||||
|
@ -46,7 +42,7 @@ class RobotSelectEntityDescription(
|
|||
|
||||
LITTER_ROBOT_SELECT = RobotSelectEntityDescription[LitterRobot, int](
|
||||
key="cycle_delay",
|
||||
name="Clean Cycle Wait Time Minutes",
|
||||
name="Clean cycle wait time minutes",
|
||||
icon="mdi:timer-outline",
|
||||
unit_of_measurement=UnitOfTime.MINUTES,
|
||||
current_fn=lambda robot: robot.clean_cycle_wait_time_minutes,
|
||||
|
@ -83,7 +79,6 @@ async def async_setup_entry(
|
|||
),
|
||||
)
|
||||
)
|
||||
async_update_unique_id(hass, PLATFORM, entities)
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue