spacemanspiff2007 / PyArtNet

"Python wrappers for the Art-Net protocol to send DMX over Ethernet"
GNU General Public License v3.0
70 stars 14 forks source link

Fades start from value 0, instead of fading from the existing value #38

Closed Breina closed 1 year ago

Breina commented 1 year ago

When doing an channel.add_fade, the fade starts from values [0, 0], instead of transitioning from the current values.

This means that in the below example, the second fade makes the light go off first, then transitions to the actual value. A consequence is also that fading to black is always instant.

I'm not adept enough to write a unit test for it, but here's a reproduction scenario at least:

import asyncio

from src.pyartnet import ArtNetNode

async def artnet():
    node = ArtNetNode("192.168.1.15", 6454)
    universe = node.add_universe(0)
    channel = universe.add_channel(start=105, width=2, byte_size=2, byte_order='big')

    channel.add_fade([0, 65535], 1000)
    await channel

    channel.add_fade([65535, 0], 1000)
    await channel

loop = asyncio.new_event_loop()
loop.run_until_complete(artnet())
spacemanspiff2007 commented 1 year ago

Thank you for the report - I can reproduce the issue. Somehow I deleted/forgot some of the fade tests 🙄

spacemanspiff2007 commented 1 year ago

Fixed in 1.0.1