Skip to content

Windows requires byte prepended to data #417

@JnyJny

Description

@JnyJny

Also, as a separate note, I had to deploy on Windows and to make it work I had to send an additional 0 to the devices. Then everything was working; without it the lights were ignoring any commands. I have no idea why it works with the 0.
And I had 2 different devices, a Luxafor ORB and a Kuando, and both behaved the same.

if "WINDOWS" in platform.system().upper():

    def patched_write_strategy(instance: lightslib.Light, data: bytes) -> int:
        data = bytes([0]) + data
        return instance.device.write(data)

    lightslib.Light.write_strategy = patched_write_strategy

Originally posted by @aponoran in #416 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions