MisterWil / abodepy

A thin Python wrapper for the Abode alarm API
MIT License
49 stars 17 forks source link

Fix enabling/disabling automations. #82

Closed sarvjeets closed 3 years ago

sarvjeets commented 3 years ago

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 commented 3 years ago

Coverage Status

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

coveralls commented 3 years ago

Coverage Status

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

sarvjeets commented 3 years ago

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

MisterWil commented 3 years ago

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

sarvjeets commented 3 years ago

Thank you. Yes, that would be great.

MisterWil commented 3 years ago

abodepy-1.2.2 is now available via pypi