mirror of
https://github.com/home-assistant/core.git
synced 2026-02-07 23:56:36 +01:00
* Implement new state property for vacuum which is using an enum * Mod * Mod init * Mods * Fix integrations * Tests * Fix state * Add vacuum tests * Fix last test * Litterrobot tests * Fixes * Tests * Fixes * Fix VacuumEntity * Mods * Mods * Mods * Update demo * LG * Fix vacuum * Fix Matter * Fix deprecation version * Mods * Fixes * Fix ruff * Fix tests * Fix roomba * Fix breaking dates
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""Support for vacuum cleaner robots (botvacs)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from enum import StrEnum
|
|
from functools import partial
|
|
|
|
from homeassistant.helpers.deprecation import (
|
|
DeprecatedConstantEnum,
|
|
all_with_deprecated_constants,
|
|
check_if_deprecated_constant,
|
|
dir_with_deprecated_constants,
|
|
)
|
|
|
|
DOMAIN = "vacuum"
|
|
|
|
|
|
class VacuumActivity(StrEnum):
|
|
"""Vacuum activity states."""
|
|
|
|
CLEANING = "cleaning"
|
|
DOCKED = "docked"
|
|
IDLE = "idle"
|
|
PAUSED = "paused"
|
|
RETURNING = "returning"
|
|
ERROR = "error"
|
|
|
|
|
|
# These STATE_* constants are deprecated as of Home Assistant 2025.1.
|
|
# Please use the VacuumActivity enum instead.
|
|
_DEPRECATED_STATE_CLEANING = DeprecatedConstantEnum(VacuumActivity.CLEANING, "2026.1")
|
|
_DEPRECATED_STATE_DOCKED = DeprecatedConstantEnum(VacuumActivity.DOCKED, "2026.1")
|
|
_DEPRECATED_STATE_RETURNING = DeprecatedConstantEnum(VacuumActivity.RETURNING, "2026.1")
|
|
_DEPRECATED_STATE_ERROR = DeprecatedConstantEnum(VacuumActivity.ERROR, "2026.1")
|
|
|
|
|
|
# These can be removed if no deprecated constant are in this module anymore
|
|
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
|
|
__dir__ = partial(
|
|
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
|
|
)
|
|
__all__ = all_with_deprecated_constants(globals())
|