CodingTheUnknown / OctoPrint-Tplinkautoshutdown

A plugin designed to be used within OctoPrint and OctoPi to control TP-Link kasa devices.
https://github.com/CodingTheUnknown/OctoPrint-Tplinkautoshutdown.git
9 stars 7 forks source link

Configuration to allow newer smart strips (HS300 specifically) #66

Closed germtuna closed 3 years ago

germtuna commented 3 years ago

I did not add additional functionality per se, only the ability to see and configure sockets on the HS300 (and presumably other >3 socket Kasa strips). Tested functionality running:

germtuna commented 3 years ago

Nothing drastic, just support for the HS300.

CodingTheUnknown commented 3 years ago

Thanks for the contribution, I'll take a look and then commit it into the main branch when I get a chance. J.

germtuna commented 3 years ago

No worries. It occurred to be that I did not update the relevant bits in README.md. Let me know if you want me to do so.

CodingTheUnknown commented 3 years ago

Thanks for that fix. Just having a look at the other stuff. Looks good. Just out of interest have you tested it with the KP303 as well to ensure that it doesn't break anything?

CodingTheUnknown commented 3 years ago

If it all works and you were interested, the other thing that could be developed on top is a way to auto detect the type of device and then change the number of sockets shown on the UI to only show either 3 or 6 sockets dependent on the users device. This is possible through using the control lib that I am using as an interface to the sockets. Although I haven't done this myself as I don't understand the complex networking setup that OctoPrint uses when sending data too and from the website UI. Then again I'm not one for web development anyway.

germtuna commented 3 years ago

I only have the HS300 (6 outlets) so I could not test. Based on the behavior before the changes, it only detected the first 3 outlets on the HS300 but worked with the 3 it found. I suspect (not looked) that the kasa python library just enumerates the device and passes it. That would lead me to assume that the KP303 would still work, but to your point the gui may not reflect the number of sockets appropriately. I will poke around a bit.

CodingTheUnknown commented 3 years ago

sure. Ive made a couple of changes and will push them in a second back into this section. make sure you pull them back down once I've pushed them up.

CodingTheUnknown commented 3 years ago

Hi give it a pull now and see the changes I have made I think it'll all work but please test it thoroughly before you confirm it works. Each plug one at a time as this will ensure all settings are working correctly.

germtuna commented 3 years ago

Pulled, Uninstalled, Reinstalled. Each plug was tested individually on/off successfully as well as all at once. Looks ok to me.

CodingTheUnknown commented 3 years ago

fantastic. All that is left then is for me to change the version numbering in a few places so that the auto-update feature on OctoPrint will work and not annoy users with a popup. After that I can release it to the public. Thanks for you input.