Skip to content
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

Fix access to embedded status containers #1682

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

rytilahti
Copy link
Owner

@rytilahti rytilahti commented Jan 24, 2023

Also, implement __dir__ to enable autocompletion for attributes of embedded containers.

Example:

In [1]: from miio import RoborockVacuum
   ...: vac = RoborockVacuum("x", "x")
   ...: stat = vac.status()

In [2]: stat.DNDStatus
Out[2]: <DNDStatus enabled=True end=08:00:00 start=22:00:00>

In [3]: stat.DNDStatus<tab>
                       DNDStatus          DNDStatus__end    
                       DNDStatus__enabled DNDStatus__start  

Also, implement __dir__ to enable autocompletion to embedded attributes
@rytilahti rytilahti merged commit 21aef76 into master Jan 24, 2023
@rytilahti rytilahti deleted the feat/devicestatus_implement_dir branch January 24, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant