Skip to content

Conversation

allenporter
Copy link
Contributor

Update traits to have a simpler syntax, but some runtime hackery.

This is an example for how to interact with the device with the new syntax:

    device_manager = await context.get_device_manager()
    device = await device_manager.get_device(device_id)

    if device.v1_properties is None:
        raise RoborockException(f"Device {device.name} does not support V1 protocol")

    status_trait = device.v1_properties.get_status
    await status_trait.refresh()
    print(status.state)

Common v1 properties are assembled into a single trait of properties and we can add more groups based on supported features (e.g. map related functionality or something else)

@allenporter allenporter requested a review from Lash-L September 21, 2025 03:58
Copy link
Contributor Author

@allenporter allenporter left a comment

Choose a reason for hiding this comment

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

PTAL, ready for another look.

Copy link
Collaborator

@Lash-L Lash-L left a comment

Choose a reason for hiding this comment

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

Looks good! Liking how everything is coming together

@allenporter allenporter merged commit 362ec1d into Python-roborock:main Sep 21, 2025
6 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