Closed sl-wallace closed 2 years ago
Ah. I was trying to use the handy from __future__ import annotations
feature to help with type hinting in this event message code - but it fails because Python 3.6 doesn't support this and the automated checks flag this.
@sde1000 when do you expect #95 to have a set date for dropping Python 3.6 support? If it's soon then I might just wait a while for this pull request, but if it's not until 2023 then I'd better go and refactor or remove my type hints!
Apologies for all the spam with the commits and re-runs of the tests, I think I can avoid using the annotations import and still get it to work for Python 3.6. I'll close this PR and create a new branch which is a bit cleaner, without all the one-line commits.
I think this is the right time to retire support for python 3.6 — this PR (well, the subsequent one) is likely to be the bulk of release 0.10; it's a new feature so there are no existing users to worry about!
IEC 62386 part 103 defines "event" messages, which can be sent by control devices to indicate various inputs or changes. This commit introduces support for encoding and decoding these messages, as well as a handful of new sequences for making it easier to work with them.
Support has been added for IEC 62386 part 301 "push button" devices, further device types should be simple enough to add in later. Unsupported types will be safely ignored by the library.