Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
theRISCyALU opened this issue Apr 7, 2017 · 0 comments

Comments

@theRISCyALU
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant