A common API for different hardware realizations of a DALI interface.
- Lunatone 241 389 23DO
- Lunatone 241 389 23-30
- BEGA 71024
- Serial based SevenLab Hardware
Note
Using the serial interface on Windows may exhibit excessive latency. This can potentially be improved by tweaking the serial driver config.
The interface classes implement the following API functions.
Transmits a DALI frame on the bus. All 8 bit frames are treated as backward frames.
def transmit(self, frame: DaliFrame, block: bool = False) -> None:Parameters
frame(DaliFrame): frame to transmitblock(bool, optional): wait for the end of transmission. Defaults to False.
Get the next DALI frame from the input queue.
def get(self, timeout: float | None = None) -> DaliFrame:Parameters
timeout(float | None, optional): time in seconds before the call returns. Defaults to None (wait until halted).
Returns
DaliFrame: time out is indicated in the frame status
Transmit a DALI frame that is requesting a reply. Wait for either the replied data, or indicate a timeout.
def query_reply(self, request: DaliFrame) -> DaliFrame:Parameters
request(DaliFrame): DALI frame to transmit
Returns
DaliFrame: the received reply, if no reply was received a frame withDaliStatus:TIMEOUTis returned
Control a built in power supply. For now, this requires a Lunatone DALI USB 30 mA interface.
def power(self, power: bool = False) -> None:Parameters
power: new power setting:Truefor power on,Falsefor power off
Class definition for DALI frames
Class definition for status of DALI frames