sde1000 / python-dali

Library for controlling DALI lighting systems
Other
150 stars 71 forks source link

Add support for DALI 24-bit event messages #103

Closed sl-wallace closed 2 years ago

sl-wallace commented 2 years ago

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.

sl-wallace commented 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!

sl-wallace commented 2 years ago

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.

sde1000 commented 2 years ago

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!