Skip to content

sevenlab-de/dali-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DALI Interface

A common API for different hardware realizations of a DALI interface.

Supported Hardware

Note

Using the serial interface on Windows may exhibit excessive latency. This can potentially be improved by tweaking the serial driver config.

API

The interface classes implement the following API functions.

Transmit

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 transmit
  • block (bool, optional): wait for the end of transmission. Defaults to False.

Get

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

Query_Reply

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 with DaliStatus:TIMEOUT is returned

Power

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: True for power on, False for power off

DaliFrame

Class definition for DALI frames

DaliStatus

Class definition for status of DALI frames

About

Provide a basic and common interface to the DALI bus

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages