Skip to content

uint8 overflow when trying to send more than 255 messages in one Lightify instance #4

@theRISCyALU

Description

@theRISCyALU

I've noted an issue that affects scripts that continually update lights (i.e. animated effect). Only 255 updates are allowed in one Lightify instance due to an unforeseen encoding issue with trying to pack a integer > 255 into an 8 bit field into the command. I suggest the following code fix to the Lightify.next_seq() function, which alleviates this issue for me. I am not trying to push because I do not understand if reuse of sequence numbers is allowed.

def next_seq(self):
    self.__seq = (self.__seq + 1) % 255
    return self.__seq

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions