Skip to content

Conversation

@allenporter
Copy link
Contributor

This is re-exposing the web API as a trait, to make it similar to other device operations hiding the API implementation details.

This is re-exposing the web API as a trait, to make it similar to other device operations hiding the API implementation details.
Copilot AI review requested due to automatic review settings October 27, 2025 02:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a RoutinesTrait to expose routine (scene) operations through a trait interface, abstracting the underlying web API implementation. This aligns the routines functionality with other device operations that use the trait pattern.

Key changes:

  • Introduces RoutinesTrait class with get_routines() and execute_routine() methods
  • Extends UserWebApiClient with convenience methods for routine operations
  • Integrates the new trait into the V1 device properties API

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
roborock/devices/traits/v1/routines.py New trait implementation for routine operations
roborock/web_api.py Added wrapper methods for routine-related API calls
roborock/devices/traits/v1/init.py Integrated RoutinesTrait into PropertiesApi
roborock/devices/device_manager.py Passed web_api client to device creation
tests/devices/traits/v1/test_routines.py Test coverage for the new trait
tests/devices/traits/v1/fixtures.py Added web_api_client fixture for testing
tests/devices/test_v1_device.py Updated device fixture with web_api mock

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@allenporter allenporter requested a review from Lash-L October 27, 2025 02:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@allenporter allenporter merged commit 05c8e94 into Python-roborock:main Oct 27, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants