mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Bump deebot-client to 7.0.0 (#116025)
This commit is contained in:
parent
2977ec4872
commit
fd14695d26
@ -13,6 +13,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .controller import EcovacsController
|
from .controller import EcovacsController
|
||||||
from .entity import EcovacsEntity
|
from .entity import EcovacsEntity
|
||||||
|
from .util import get_name_key
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
@ -54,10 +55,7 @@ class EcovacsLastJobEventEntity(
|
|||||||
# we trigger only on job done
|
# we trigger only on job done
|
||||||
return
|
return
|
||||||
|
|
||||||
event_type = event.status.name.lower()
|
event_type = get_name_key(event.status)
|
||||||
if event.status == CleanJobStatus.MANUAL_STOPPED:
|
|
||||||
event_type = "manually_stopped"
|
|
||||||
|
|
||||||
self._trigger_event(event_type)
|
self._trigger_event(event_type)
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/ecovacs",
|
"documentation": "https://www.home-assistant.io/integrations/ecovacs",
|
||||||
"iot_class": "cloud_push",
|
"iot_class": "cloud_push",
|
||||||
"loggers": ["sleekxmppfs", "sucks", "deebot_client"],
|
"loggers": ["sleekxmppfs", "sucks", "deebot_client"],
|
||||||
"requirements": ["py-sucks==0.9.9", "deebot-client==6.0.2"]
|
"requirements": ["py-sucks==0.9.9", "deebot-client==7.0.0"]
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ from .entity import (
|
|||||||
EcovacsDescriptionEntity,
|
EcovacsDescriptionEntity,
|
||||||
EventT,
|
EventT,
|
||||||
)
|
)
|
||||||
from .util import get_supported_entitites
|
from .util import get_name_key, get_supported_entitites
|
||||||
|
|
||||||
|
|
||||||
@dataclass(kw_only=True, frozen=True)
|
@dataclass(kw_only=True, frozen=True)
|
||||||
@ -41,8 +41,8 @@ ENTITY_DESCRIPTIONS: tuple[EcovacsSelectEntityDescription, ...] = (
|
|||||||
EcovacsSelectEntityDescription[WaterInfoEvent](
|
EcovacsSelectEntityDescription[WaterInfoEvent](
|
||||||
device_capabilities=VacuumCapabilities,
|
device_capabilities=VacuumCapabilities,
|
||||||
capability_fn=lambda caps: caps.water,
|
capability_fn=lambda caps: caps.water,
|
||||||
current_option_fn=lambda e: e.amount.display_name,
|
current_option_fn=lambda e: get_name_key(e.amount),
|
||||||
options_fn=lambda water: [amount.display_name for amount in water.types],
|
options_fn=lambda water: [get_name_key(amount) for amount in water.types],
|
||||||
key="water_amount",
|
key="water_amount",
|
||||||
translation_key="water_amount",
|
translation_key="water_amount",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -50,8 +50,8 @@ ENTITY_DESCRIPTIONS: tuple[EcovacsSelectEntityDescription, ...] = (
|
|||||||
EcovacsSelectEntityDescription[WorkModeEvent](
|
EcovacsSelectEntityDescription[WorkModeEvent](
|
||||||
device_capabilities=VacuumCapabilities,
|
device_capabilities=VacuumCapabilities,
|
||||||
capability_fn=lambda caps: caps.clean.work_mode,
|
capability_fn=lambda caps: caps.clean.work_mode,
|
||||||
current_option_fn=lambda e: e.mode.display_name,
|
current_option_fn=lambda e: get_name_key(e.mode),
|
||||||
options_fn=lambda cap: [mode.display_name for mode in cap.types],
|
options_fn=lambda cap: [get_name_key(mode) for mode in cap.types],
|
||||||
key="work_mode",
|
key="work_mode",
|
||||||
translation_key="work_mode",
|
translation_key="work_mode",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
|
@ -2,12 +2,15 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from enum import Enum
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from deebot_client.capabilities import Capabilities
|
from deebot_client.capabilities import Capabilities
|
||||||
|
|
||||||
|
from homeassistant.core import callback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import (
|
||||||
EcovacsCapabilityEntityDescription,
|
EcovacsCapabilityEntityDescription,
|
||||||
EcovacsDescriptionEntity,
|
EcovacsDescriptionEntity,
|
||||||
@ -38,3 +41,9 @@ def get_supported_entitites(
|
|||||||
if isinstance(device.capabilities, description.device_capabilities)
|
if isinstance(device.capabilities, description.device_capabilities)
|
||||||
if (capability := description.capability_fn(device.capabilities))
|
if (capability := description.capability_fn(device.capabilities))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@callback
|
||||||
|
def get_name_key(enum: Enum) -> str:
|
||||||
|
"""Return the lower case name of the enum."""
|
||||||
|
return enum.name.lower()
|
||||||
|
@ -33,6 +33,7 @@ from homeassistant.util import slugify
|
|||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .controller import EcovacsController
|
from .controller import EcovacsController
|
||||||
from .entity import EcovacsEntity
|
from .entity import EcovacsEntity
|
||||||
|
from .util import get_name_key
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -242,7 +243,7 @@ class EcovacsVacuum(
|
|||||||
self._rooms: list[Room] = []
|
self._rooms: list[Room] = []
|
||||||
|
|
||||||
self._attr_fan_speed_list = [
|
self._attr_fan_speed_list = [
|
||||||
level.display_name for level in capabilities.fan_speed.types
|
get_name_key(level) for level in capabilities.fan_speed.types
|
||||||
]
|
]
|
||||||
|
|
||||||
async def async_added_to_hass(self) -> None:
|
async def async_added_to_hass(self) -> None:
|
||||||
@ -254,7 +255,7 @@ class EcovacsVacuum(
|
|||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def on_fan_speed(event: FanSpeedEvent) -> None:
|
async def on_fan_speed(event: FanSpeedEvent) -> None:
|
||||||
self._attr_fan_speed = event.speed.display_name
|
self._attr_fan_speed = get_name_key(event.speed)
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def on_rooms(event: RoomsEvent) -> None:
|
async def on_rooms(event: RoomsEvent) -> None:
|
||||||
|
@ -694,7 +694,7 @@ debugpy==1.8.1
|
|||||||
# decora==0.6
|
# decora==0.6
|
||||||
|
|
||||||
# homeassistant.components.ecovacs
|
# homeassistant.components.ecovacs
|
||||||
deebot-client==6.0.2
|
deebot-client==7.0.0
|
||||||
|
|
||||||
# homeassistant.components.ihc
|
# homeassistant.components.ihc
|
||||||
# homeassistant.components.namecheapdns
|
# homeassistant.components.namecheapdns
|
||||||
|
@ -572,7 +572,7 @@ dbus-fast==2.21.1
|
|||||||
debugpy==1.8.1
|
debugpy==1.8.1
|
||||||
|
|
||||||
# homeassistant.components.ecovacs
|
# homeassistant.components.ecovacs
|
||||||
deebot-client==6.0.2
|
deebot-client==7.0.0
|
||||||
|
|
||||||
# homeassistant.components.ihc
|
# homeassistant.components.ihc
|
||||||
# homeassistant.components.namecheapdns
|
# homeassistant.components.namecheapdns
|
||||||
|
@ -76,7 +76,7 @@ async def test_last_job(
|
|||||||
await notify_and_wait(
|
await notify_and_wait(
|
||||||
hass,
|
hass,
|
||||||
event_bus,
|
event_bus,
|
||||||
ReportStatsEvent(0, 1, "spotArea", "3", CleanJobStatus.MANUAL_STOPPED, [1]),
|
ReportStatsEvent(0, 1, "spotArea", "3", CleanJobStatus.MANUALLY_STOPPED, [1]),
|
||||||
)
|
)
|
||||||
|
|
||||||
assert (state := hass.states.get(state.entity_id))
|
assert (state := hass.states.get(state.entity_id))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user