Skip to content

Conversation

@cebtenzzre
Copy link
Contributor

Use None consistently as the placeholder for the pin value, and never -1, as validate_pin rejects -1 with an exception and can be called before the thread's pin is set:

listen_state(callback, entity)  # no pin_thread specified
    → determine_thread(name, None, None)
    → pin_thread = objects[name].pin_thread  # gets -1
    → validate_pin(name, -1)
    → -1 < 0 is True
    → raise PinOutofRange  💥

Fixes #2343

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

Successfully merging this pull request may close these issues.

Thread pinning doesn't seem to work as intended.

1 participant