-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Add support for TPLinkSmartPlug plugin #1256
Add support for TPLinkSmartPlug plugin #1256
Conversation
2c9b136
to
335cd63
Compare
Thank you for your contribution! This looks really promising. I'm kind of busy right now, so it probably will take me a day or two to review this. But from a first glance everything looked alright! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really solid PR for a highly requested feature. Thank you so much!
I just have one really minor issue with this, with your changes the turnOnPowerWhenExitingSleep will exist twice which might be a bit confusing to some users. I'd prefer if we keep the already existing attribute and then just check whether TPLink SmartPlug Plugin is enabled (then use the TPLink SmartPlug) or not (then use PSUControl). I proposed some changes (altough not tested), but they should work I think. Let me know if you have any objections on removing turnOnPowerWhenExitingSleep
from the TPLink Plugin :)
edit: Might be a good idea to rename the toggle to turn on power when exiting sleep (on the UI side should be more than enough) to make it less confusing.
Yep, it looks better to have only one button to do that. Moreover, it allows us to extends OctoDash with another PSU plugin more easier in the future ^^. I will apply these changes and test it today. Also, I have an idea for this option; What about moving the option Thanks a lot for your review. |
8625748
to
02ce484
Compare
After testing with suggestion, moving the EDIT: I push a working draft of this idea. It also avoid breaking changes with the current PSUControl settings |
cf29dd5
to
fa5e9b1
Compare
I have another issue ... when I upgrade from the last release to the next with my PR, the settings menu is broken. The only way I found to fix it is to add manually the TPLink plugin settings section inside the
|
Signed-off-by: Alexandre Nicolaie <[email protected]>
Apply suggestion of Timon G. about this option, from Github Co-authored-by: Timon G. <[email protected]>
Signed-off-by: Alexandre Nicolaie <[email protected]>
eccc8e9
to
6b1b290
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That migrate function is awesome! That is something that I've been wanting to do from the beginning but didn't really know how to tackle. Thanks for cleaning that up and making future config changes a lot easier!
I feel bad to request some more changes, but I think the migratePSUControl is better fitted in your new awesome migrate function! After that this is ready to be merged and will then be included in the next release :)
799b563
to
2fde959
Compare
Co-authored-by: Timon G. <[email protected]>
2fde959
to
cb72e47
Compare
All is fixed. I also use the optional chaining in Thanks for your review and your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
* Add support for TPLinkSmartPlug plugin Signed-off-by: Alexandre Nicolaie <[email protected]> * Remove `turnOnPowerWhenExitingSleep` option from TPLink settings Apply suggestion of Timon G. about this option, from Github Co-authored-by: Timon G. <[email protected]> * Move turnOnPSUWhenExitingSleep to Octodash settings Signed-off-by: Alexandre Nicolaie <[email protected]> * Remove `migratePSUControlOption` function & clean code Co-authored-by: Timon G. <[email protected]> Co-authored-by: Timon G. <[email protected]>
Add the support for TP Link as alternative of PSU Controler plugin (and fix the issue #1244).
It implements 2 custom actions (
[!TPLINKOFF]
and[!TPLINKON]
) and an option to power on the smartplug when the standby mode exits. I tested these changes on my RPi 3B (and on my laptop) and it seems working without any issues (this is barely a copy/paste of the PSU plugin, without the toggle feature).Unfortunately, we need a keyboard to setup the IP address in the settings menu (or edit the
config.json
file).Closes #1244