dickydoouk / tp-link-tapo-connect

Unofficial Node.js library for connecting to TP-Link Tapo devices. Currently limited to the P100 & P105 smart plugs and L510E smart bulbs.
115 stars 41 forks source link

Adding support for turnOnAfter and turnOffAfter #16

Closed dewhurstwill closed 2 years ago

dewhurstwill commented 2 years ago

14 Timeout - Adding support for turnOnAfter and turnOffAfter

dickydoouk commented 2 years ago

Thanks for doing this @dewhurstwill and although it is possible to create these functions using setTimeout function. I am reluctant to add this functionality until we can find out a native way of using the timer functionality that TP-Link provide. I am under the assumption that there is a hidden schedule API we could reverse engineer which will allow us to tap (excuse the pun) into the smart plug the way the official Tapo app does. Another problem is this PR in its current form will not return control to the caller until the action has been performed and in my opinion this is rather trivial for a calling app to manage themselves. Thanks anyway and keep the contributions coming.