Skip to content

Fix enabling/disabling automations.#82

Merged
MisterWil merged 1 commit intoMisterWil:masterfrom
sarvjeets:fix-activate-automation
Jun 16, 2021
Merged

Fix enabling/disabling automations.#82
MisterWil merged 1 commit intoMisterWil:masterfrom
sarvjeets:fix-activate-automation

Conversation

@sarvjeets
Copy link
Contributor

@sarvjeets sarvjeets commented May 11, 2021

I noticed that enabling/disabling automations was broken as 'set_active' method was renamed to 'enable'. With this change, I'm able to enable/disable the Abode automations.

Without this change:
$ abodepy -u ... -p ... --deactivate xxx
2021-05-10 10:51:52 INFO (MainThread) [abodepy] Updating all devices...
2021-05-10 10:51:52 INFO (MainThread) [abodepy] Login successful
2021-05-10 10:51:52 INFO (MainThread) [abodepy] Updating all automations...
2021-05-10 10:51:53 INFO (MainThread) [abodepy] Logout successful
Traceback (most recent call last):
File "/home/sarvjeet/.local/bin/abodepy", line 8, in
sys.exit(main())
File "/home/sarvjeet/.local/lib/python3.8/site-packages/abodepy/main.py", line 454, in main
call()
File "/home/sarvjeet/.local/lib/python3.8/site-packages/abodepy/main.py", line 339, in call
if automation.set_active(False):
AttributeError: 'AbodeAutomation' object has no attribute 'set_active'
$

With this change:
$ abodepy -u ... -p ... --deactivate xxx
2021-05-10 22:09:33 INFO (MainThread) [abodepy] Updating all devices...
2021-05-10 22:09:33 INFO (MainThread) [abodepy] Login successful
2021-05-10 22:09:33 INFO (MainThread) [abodepy] Updating all automations...
2021-05-10 22:09:33 INFO (MainThread) [abodepy.automation] Set automation XXX enable to: False
2021-05-10 22:09:33 INFO (MainThread) [abodecl] Deactivated automation with id: xxx
2021-05-10 22:09:34 INFO (MainThread) [abodepy] Logout successful
$

Thanks.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.833% when pulling a902772 on sarvjeets:fix-activate-automation into cf082a2 on MisterWil:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 83.833% when pulling a902772 on sarvjeets:fix-activate-automation into cf082a2 on MisterWil:master.

@sarvjeets
Copy link
Contributor Author

@MisterWil Please let me know if you need anything from my side to review this pull request. Thanks

@MisterWil MisterWil merged commit a177c76 into MisterWil:master Jun 16, 2021
@MisterWil
Copy link
Owner

Thanks for fixing this! Do you need a new version pushed out too?

@sarvjeets
Copy link
Contributor Author

Thank you. Yes, that would be great.

@MisterWil
Copy link
Owner

abodepy-1.2.2 is now available via pypi

@sarvjeets sarvjeets deleted the fix-activate-automation branch June 25, 2021 03:55
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.

3 participants