Closed henryruhs closed 3 years ago
await light.turn_on(PilotBuilder(scene = 4))
with
from pywizlight.scenes import SCENES
Sorry, but I don't want to turn on/off scenes that have to be defined via the app - I would like to create an effect programmatically via code instructions as I have to pass the color aswell.
ah, so you can use the "normal" PilotBuilder to create different light setups. I'm currently reversing. the FW of one bulb and found some more useful UDP features like changing the fade-in and fade-out.
Great! Could you introduce some shorthand methods to control this?
Mh, you can do something like this:
async def police_effect():
bulb = wizlight("192.168.178.95")
await bulb.turn_on(PilotBuilder(rgb=(255, 0, 0)))
time.sleep(1)
await bulb.turn_on(PilotBuilder(rgb=(0, 0, 255)))
time.sleep(1)
await bulb.turn_on(PilotBuilder(rgb=(255, 0, 0)))
time.sleep(1)
await bulb.turn_on(PilotBuilder(rgb=(0, 0, 255)))
time.sleep(1)
But you have to change the fade-in and fade-out value to 0 in the WiZ app. Because it is not possible to set these via UDP API.
I am waiting for this being implemented as a shortcut method, thanks...
def pulsate((r, g, b), delay)
Unfortunately this will not come into the lib. The transition speed is not supported by the UDP API and must be configured via the WiZ app. We can only manipulate the color but not the speed of "state changes" see the discussion in #40.
Maybe there is something coming up in the future.
@sbidy Is there a way to use effects like breath/pulsate or spectrum?