Skip to content

Conversation

Lash-L
Copy link
Collaborator

@Lash-L Lash-L commented Aug 13, 2025

There are some things i have to figure out (i.e. typing in some places)

And how to get locations to the trait

And how much of a breaking change is okay vs if i should try to make both possible at the same time

@Lash-L Lash-L requested a review from allenporter August 13, 2025 01:09
roborock/cli.py Outdated
@@ -235,7 +235,7 @@ async def status(ctx, device_id):
devices = home_data.devices + home_data.received_devices
device = next(device for device in devices if device.duid == device_id)
product_info: dict[str, HomeDataProduct] = {product.id: product for product in home_data.products}
device_data = DeviceData(device, product_info[device.product_id].model)
device_data = DeviceData(device, product_info[device.product_id].model, region=cache_data.user_data.region)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are kind of in a weird situation.

We need the DeviceFeatures in order to create the valid options for Status - so it is stored in DeviceData. But we need DeviceData in order to set up the client - which we need to call get_init_status to get the DeviceFeatures.

Maybe the client just has a function to update it's "app_init_status" and then it updates it's status? Any thoughts?

@Lash-L
Copy link
Collaborator Author

Lash-L commented Aug 14, 2025

I removed the more complicated changes that we can discuss in a follow up PR

@Lash-L Lash-L requested a review from allenporter August 16, 2025 17:52
Copy link
Contributor

@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.

It may be worth clarifying in clean_modes.py what is internal vs part of the public api. One way you can do this is by setting __all__ = [ ... ] to the list of public things or empty if this is totally private and internal.

my assumption is that file is moslty internal and the actual things we want callers to check will be in a trait when those are ready.

@Lash-L
Copy link
Collaborator Author

Lash-L commented Aug 24, 2025

It may be worth clarifying in clean_modes.py what is internal vs part of the public api. One way you can do this is by setting __all__ = [ ... ] to the list of public things or empty if this is totally private and internal.

my assumption is that file is moslty internal and the actual things we want callers to check will be in a trait when those are ready.

It is actually basically all external. You provide the device features, we will tell you which of the modes your device supports.

@Lash-L Lash-L requested a review from allenporter September 2, 2025 22:59
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