Closed patlaniel closed 3 years ago
Thanks for your contribution!
My pleasure!
------ Original Message ------ From: "Anthony Turner" notifications@github.com To: "anthturner/TPLinkSmartDevices" TPLinkSmartDevices@noreply.github.com Cc: "ctq-dev" pedaleux@gmail.com; "Author" author@noreply.github.com Sent: 2021-02-12 11:30:29 AM Subject: Re: [anthturner/TPLinkSmartDevices] Implemented the countdown feature + improved discovery efficiency + multi-language support (#10)
Thanks for your contribution!
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anthturner/TPLinkSmartDevices/pull/10#issuecomment-778298303, or unsubscribe https://github.com/notifications/unsubscribe-auth/APZ5JNMUA5QN4CS64FJ4IMTS6VJSLANCNFSM4XJCSKVA.
I hope it's not a problem to propose three separate improvements in a single PR but each one of them involves very little code change.
I implemented the countdown feature, whereby the on/off state of the device can be set when a countdown expires. Since I only own smart switches (HS200 - which incidentally are discovered as smart plugs), I don't know what other devices support this feature. I guess the countdown support could eventually be moved in the device base class.
I also improved the Discover() function with an optional "maxNumberOfDevicesToDiscover" parameter. The discovery returns immediately when the specified number of devices have been discovered, which makes the discovery much faster when you know how many devices are installed. There is no need to wait for an amount of time.
Finally, the device responses are decoded as UTF-8 strings for multi-language support (my device's aliases have accented characters).
Hope this helps.