Add control for colour temperature and colour and fix brightness jumping #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7
I have a couple of L530 bulbs and wanted to get the colour changing working through Home Assistant.
This relies on the PR I put in for TapoP100 (so required version of PyP100 will need upping in the manifest, but I haven't done that yet).
It turns out there was quite a lot to do to make it work properly, so there are quite a few changes here.
It's all working for me, but I don't have any L510 bulbs to test it with. It would be good for someone else to confirm that it works as expected with those bulbs.
The only slight annoyance is that after you set the brightness, colour or colour temperature, it then jumps and jumps back after half a second, I haven't worked out how to fix this yet (but it does now jump back to where it was originally set).
Quite a lot of inspiration and code was taken from the yeelight integration which seems to be under the HA core license of Apache 2.0. Not sure if that's compatible, or if the license of this needs updating.