-
-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Add Full support for roborock Zeo washing/drying machines #159575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
allenporter
merged 41 commits into
home-assistant:dev
from
yangqian:roborock-cloud-push-for-A01-devices
Feb 25, 2026
Merged
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
3691ee9
initial support for roborock washing machine
yangqian 6f46863
fix commented out code
yangqian 71e78d2
Format A01 code: remove commented lines, fix trailing spaces, use laz…
yangqian 1d8c12d
ruff format
yangqian 1965044
Refactor imports in Roborock components: remove unused imports and cl…
yangqian 67b1510
Format button and switch code: improve readability by breaking long l…
yangqian 628f6bc
Address PR review comments for roborock washing machine integration
yangqian b68d653
revert changes on battery sensor and error descriptions for A01 devices
yangqian 85d6000
Remove unnecessary condition for A01 switch descriptions in setup entry
yangqian 2c0d912
Rename A01 button descriptions to ZEO_BUTTON_DESCRIPTIONS and update …
yangqian 9c2123b
Format import statements for improved readability
yangqian 1f2baac
Update homeassistant/components/roborock/strings.json
yangqian f053d2d
Update softener_type snapshot to match mock data (medium, not low)
yangqian 18b290d
Move detergent_type and softener_type from sensor to select
yangqian bd92367
Update homeassistant/components/roborock/strings.json
yangqian 2f65e2b
Update homeassistant/components/roborock/strings.json
yangqian de3b331
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian 8c85379
Move Zeo detergent and softener empty to binary sensors
yangqian 0c11354
move async requet out of try block
yangqian 3d0309d
Add ServiceValidationError for invalid select options in RoborockSele…
yangqian 389d690
Handle Roborock command failures with appropriate error messaging in …
yangqian c08ff68
Add tests for A01 Zeo select entities including success and failure s…
yangqian 31028ad
Add detergent and softener states in translations
yangqian 5def17b
Add snapshot tests for roborock button and switch entities
yangqian 8abb99f
Update binary sensor snapshots for washing machine entities
yangqian 02e5e9c
Add test coverage for A01 select entity None value handling
yangqian 2ac66e2
Update homeassistant/components/roborock/strings.json
yangqian d0680b8
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian f8ea6c0
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian 240224d
Merge remote-tracking branch 'origin/dev' into roborock-cloud-push-fo…
yangqian 6671238
Remove unused RoborockDataUpdateCoordinatorB01 import from sensor.py
yangqian da05a60
Filter A01 select and switch entities by supported data protocols
yangqian 52ef3ee
Remove unused Dyad Pro Sound setting snapshots from test_switch.ambr
yangqian 6e38b7d
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian 0c11573
Remove unused error states and add aftercare status in Roborock strings
yangqian 0fb54b2
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian 2bbe027
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
joostlek 2df26e9
Add edge test for A01 switch handling unknown state when API omits pr…
yangqian 87a88c0
Update drying error messages for clarity in Roborock integration
yangqian 2cf3708
Remove unused value_fn from RoborockSensorDescriptionA01
yangqian 2c1a5f9
Merge branch 'dev' into roborock-cloud-push-for-A01-devices
yangqian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |||||||||||
|
|
||||||||||||
| from roborock.devices.traits.v1.consumeable import ConsumableAttribute | ||||||||||||
| from roborock.exceptions import RoborockException | ||||||||||||
| from roborock.roborock_message import RoborockZeoProtocol | ||||||||||||
|
|
||||||||||||
| from homeassistant.components.button import ButtonEntity, ButtonEntityDescription | ||||||||||||
| from homeassistant.const import EntityCategory | ||||||||||||
|
|
@@ -18,8 +19,13 @@ | |||||||||||
| from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback | ||||||||||||
|
|
||||||||||||
| from .const import DOMAIN | ||||||||||||
| from .coordinator import RoborockConfigEntry, RoborockDataUpdateCoordinator | ||||||||||||
| from .entity import RoborockEntity, RoborockEntityV1 | ||||||||||||
| from .coordinator import ( | ||||||||||||
| RoborockConfigEntry, | ||||||||||||
| RoborockDataUpdateCoordinator, | ||||||||||||
| RoborockDataUpdateCoordinatorA01, | ||||||||||||
| RoborockWashingMachineUpdateCoordinator, | ||||||||||||
| ) | ||||||||||||
| from .entity import RoborockCoordinatedEntityA01, RoborockEntity, RoborockEntityV1 | ||||||||||||
|
|
||||||||||||
| _LOGGER = logging.getLogger(__name__) | ||||||||||||
|
|
||||||||||||
|
|
@@ -65,6 +71,32 @@ class RoborockButtonDescription(ButtonEntityDescription): | |||||||||||
| ] | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| @dataclass(frozen=True, kw_only=True) | ||||||||||||
| class RoborockButtonDescriptionA01(ButtonEntityDescription): | ||||||||||||
| """Describes a Roborock A01 button entity.""" | ||||||||||||
|
|
||||||||||||
| data_protocol: RoborockZeoProtocol | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| ZEO_BUTTON_DESCRIPTIONS = [ | ||||||||||||
| RoborockButtonDescriptionA01( | ||||||||||||
| key="start", | ||||||||||||
| data_protocol=RoborockZeoProtocol.START, | ||||||||||||
| translation_key="start", | ||||||||||||
| ), | ||||||||||||
| RoborockButtonDescriptionA01( | ||||||||||||
| key="pause", | ||||||||||||
| data_protocol=RoborockZeoProtocol.PAUSE, | ||||||||||||
| translation_key="pause", | ||||||||||||
| ), | ||||||||||||
| RoborockButtonDescriptionA01( | ||||||||||||
| key="shutdown", | ||||||||||||
| data_protocol=RoborockZeoProtocol.SHUTDOWN, | ||||||||||||
| translation_key="shutdown", | ||||||||||||
| ), | ||||||||||||
| ] | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| async def async_setup_entry( | ||||||||||||
| hass: HomeAssistant, | ||||||||||||
| config_entry: RoborockConfigEntry, | ||||||||||||
|
|
@@ -98,6 +130,15 @@ async def async_setup_entry( | |||||||||||
| ) | ||||||||||||
| for routine in routines | ||||||||||||
| ), | ||||||||||||
| ( | ||||||||||||
| RoborockButtonEntityA01( | ||||||||||||
| coordinator, | ||||||||||||
| description, | ||||||||||||
| ) | ||||||||||||
| for coordinator in config_entry.runtime_data.a01 | ||||||||||||
| if isinstance(coordinator, RoborockWashingMachineUpdateCoordinator) | ||||||||||||
| for description in ZEO_BUTTON_DESCRIPTIONS | ||||||||||||
| ), | ||||||||||||
| ) | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
|
|
@@ -160,3 +201,35 @@ def __init__( | |||||||||||
| async def async_press(self, **kwargs: Any) -> None: | ||||||||||||
| """Press the button.""" | ||||||||||||
| await self._coordinator.execute_routines(self._routine_id) | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| class RoborockButtonEntityA01(RoborockCoordinatedEntityA01, ButtonEntity): | ||||||||||||
| """A class to define Roborock A01 button entities.""" | ||||||||||||
|
|
||||||||||||
| entity_description: RoborockButtonDescriptionA01 | ||||||||||||
|
|
||||||||||||
| def __init__( | ||||||||||||
| self, | ||||||||||||
| coordinator: RoborockDataUpdateCoordinatorA01, | ||||||||||||
| entity_description: RoborockButtonDescriptionA01, | ||||||||||||
| ) -> None: | ||||||||||||
| """Create an A01 button entity.""" | ||||||||||||
| self.entity_description = entity_description | ||||||||||||
| super().__init__( | ||||||||||||
| f"{entity_description.key}_{coordinator.duid_slug}", coordinator | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| async def async_press(self) -> None: | ||||||||||||
| """Press the button.""" | ||||||||||||
| try: | ||||||||||||
| await self.coordinator.api.set_value( # type: ignore[attr-defined] | ||||||||||||
| self.entity_description.data_protocol, | ||||||||||||
| 1, | ||||||||||||
| ) | ||||||||||||
| except RoborockException as err: | ||||||||||||
| raise HomeAssistantError( | ||||||||||||
| translation_domain=DOMAIN, | ||||||||||||
| translation_key="button_press_failed", | ||||||||||||
|
||||||||||||
| translation_key="button_press_failed", | |
| translation_key="command_failed", | |
| translation_placeholders={ | |
| "command": "BUTTON_PRESS", | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.