sbidy / pywizlight

A python connector for WiZ devices
MIT License
450 stars 75 forks source link

How to set arbitrary RGB colors using the easy tool? #156

Open unfa opened 1 year ago

unfa commented 1 year ago

I've managed to turn on/off my lights using the simple tool, but when I tried using set_state or the Python example code I had errors and wasn't able to set arbitrary RGB colors.

Would it be possible to add an option to set RGB colors in the easy tool? If it is already possible - is there any documentation or examples of how to do that? I wasn't abel to figure it out based on the help text and Python code alone.

sbidy commented 1 year ago

You can do this with await light.turn_on(PilotBuilder(rgb = (0, 128, 255))) this will turn_on the bulb with the defined rgb values. In the CLI "tool" you can't do this.

A full example you can find in the readme (create the need objects etc.).

unfa commented 1 year ago

Thanks. I managed to implement this using Godot game engine. I've looked into pywizlight's source code to find out what data is sent and I have figured out how to send UDP packets from Godot.

Demo and source code are here: https://youtu.be/SEbsYTw1rY8