Conversation
roborock/cli.py
Outdated
| 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) |
There was a problem hiding this comment.
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?
|
I removed the more complicated changes that we can discuss in a follow up PR |
allenporter
left a comment
There was a problem hiding this comment.
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. |
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