Repository navigation
Add emergency lighting (DT1) memory bank 208 and query helpers - #159
Open
markus-becker-tridonic-com wants to merge 3 commits into
Open
markus-becker-tridonic-com wants to merge 3 commits into
markus-becker-tridonic-com wants to merge 3 commits into
Conversation
Implements the IEC 62386-202 self-contained emergency control gear variable definitions and sequence helpers consumed by application controllers: - dali/memory/emergency.py: memory bank 208 (Table 18) with the control gear temperatures, battery charge/maintenance powers, rated duration, recharge/function-test times, and the full set of failure, mode, test and lamp counters. - dali/gear/sequences.py: QueryEmergencyInformation bundles the DT1 status and measurement queries into a single sequence (so the required ENABLE DEVICE TYPE 1 prefix is injected), and EmergencyCommand issues a single DT1 control command. - Fake gear emergency support plus tests for the bank, the information sequence and the control-command helper. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
markus-becker-tridonic-com
force-pushed
the
dt1
branch
from
October 7, 2026 10:45
1fa16e4 to
b045191
Compare
sde1000
reviewed
Oct 7, 2026
| emergency control gear in a single sequence. | ||
|
|
||
| Running it as a sequence ensures the required "ENABLE DEVICE TYPE 1" | ||
| command is sent before each application-extended command, so the gear |
Owner
There was a problem hiding this comment.
This comment is misleading. This being a sequence has nothing to do with the driver sending appropriate EnableDeviceType commands.
There was a problem hiding this comment.
Fixed in 3697e86.
sde1000
reviewed
Oct 7, 2026
| command is sent before each application-extended command, so the gear | ||
| answers. The returned values are plain integers (or None where the gear | ||
| reports MASK or does not answer); the four status bytes are returned as | ||
| raw bytes so the caller can decode individual bits. |
Owner
There was a problem hiding this comment.
I think it would be more useful for the status to be decoded here and represented in EmergencyInformation.
Might it be better for EmergencyInformation to be a dataclass rather than a namedtuple so its members can be typed appropriately?
There was a problem hiding this comment.
Done in 3847672.
The driver sends EnableDeviceType before every application-extended command on its own, independent of whether the command is part of a sequence. Reword the docstring to state the actual benefit: bundling the queries into one transaction so nothing interleaves between them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Represent the four DT1 status bytes as EmergencyMode, EmergencyFeatures, EmergencyFailureStatus and EmergencyStatus dataclasses with one bool field per IEC 62386-202 bit, and turn EmergencyInformation itself into a dataclass so every member is typed. Callers no longer have to know the bit layout. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements IEC 62386-202 self-contained emergency control-gear support: the
memory bank 208 variable definitions and the sequence helpers an application
controller needs to read emergency status and issue DT1 control commands.
What's included
dali/memory/emergency.py— memory bank 208 (Table 18): control-geartemperatures, battery charge/maintenance powers, rated duration,
recharge/function-test times, and the full set of failure, mode, test and
lamp counters (~40
MemoryValuedefinitions).dali/gear/sequences.pyQueryEmergencyInformation(address)— bundles the DT1 status andmeasurement queries into a single sequence so the required
ENABLE DEVICE TYPE 1prefix is injected correctly.EmergencyCommand(address, command_class)— issues a single DT1 controlcommand.
sequence, and the control-command helper.
Testing
pytest dali/tests/test_emergency.py dali/tests/test_memory.py→ 27 passed.Notes
Builds on the existing
dali/gear/emergency.pycommand classes already inmaster. Single commit, applies cleanly on top ofmaster.