Lighting Application¶
The lighting application is the most commonly used application on the C-Bus network.
It is used for turning lights on and off, and setting lights to a particular brightness.
Sometimes the lighting application is used to control other, non-lighting loads, such as exhaust fans.
Please refer to this document in conjunction with the Lighting Application Guide published by Clipsal.
-
class
cbus.protocol.application.lighting.
LightingApplication
¶ Bases:
cbus.protocol.application.sal.BaseApplication
This class is called in the cbus.protocol.applications.APPLICATIONS dict in order to describe how to decode lighting application events recieved from the network.
Do not call this class directly.
-
static
decode_sals
(data: bytes) → List[cbus.protocol.application.sal.SAL]¶ Decodes a SAL message
-
static
supported_applications
() → FrozenSet[int]¶ Gets a list of supported Application IDs for the application.
All application IDs must be in the range 0x00 - 0xff.
-
static
-
class
cbus.protocol.application.lighting.
LightingSAL
(group_address: int)¶ Bases:
cbus.protocol.application.sal.SAL
,abc.ABC
Base type for lighting application SALs.
This should not be called directly by your code!
Use one of the subclasses of cbus.protocol.lighting.LightingSAL instead.
-
application
¶
-
static
decode
(data: bytes, command_code: int, group_address: int) → Tuple[Optional[cbus.protocol.application.lighting.LightingSAL], bytes]¶
-
static
decode_sals
(data: bytes) → List[cbus.protocol.application.lighting.LightingSAL]¶ Decodes a lighting application packet and returns it’s SAL(s).
Parameters: data – SAL data to be parsed. Returns: The SAL messages contained within the given data. Return type: list of cbus.protocol.application.lighting.LightingSAL
-
encode
() → bytes¶ Encodes the SAL into a format for sending over the C-Bus network.
-
-
class
cbus.protocol.application.lighting.
LightingRampSAL
(group_address: int, duration: int, level: int)¶ Bases:
cbus.protocol.application.lighting.LightingSAL
Lighting Ramp (fade) event SAL
Instructs the given group address to fade to a lighting level (brightness) over a given duration.
Creates a new SAL Lighting Ramp message.
Parameters: - group_address (int) – The group address to ramp.
- duration (int) – The duration to ramp over, in seconds.
- level (int) – The level to ramp to, with 0 indicating off, and 255 indicating full brightness.
-
static
decode
(data: bytes, command_code: int, group_address: int) → Tuple[Optional[cbus.protocol.application.lighting.LightingSAL], bytes]¶ Do not call this method directly – use LightingSAL.decode
-
encode
() → bytes¶ Encodes the SAL into a format for sending over the C-Bus network.
-
class
cbus.protocol.application.lighting.
LightingOnSAL
(group_address: int)¶ Bases:
cbus.protocol.application.lighting.LightingSAL
Lighting on event SAL
Instructs a given group address to turn it’s load on.
This should not be called directly by your code!
Use one of the subclasses of cbus.protocol.lighting.LightingSAL instead.
-
static
decode
(data: bytes, command_code: int, group_address: int) → Tuple[cbus.protocol.application.lighting.LightingOnSAL, bytes]¶ Do not call this method directly – use LightingSAL.decode
-
encode
()¶ Encodes the SAL into a format for sending over the C-Bus network.
-
static
-
class
cbus.protocol.application.lighting.
LightingOffSAL
(group_address: int)¶ Bases:
cbus.protocol.application.lighting.LightingSAL
Lighting off event SAL
Instructs a given group address to turn it’s load off.
This should not be called directly by your code!
Use one of the subclasses of cbus.protocol.lighting.LightingSAL instead.
-
static
decode
(data: bytes, command_code: int, group_address: int) → Tuple[cbus.protocol.application.lighting.LightingOffSAL, bytes]¶ Do not call this method directly – use LightingSAL.decode
-
encode
()¶ Encodes the SAL into a format for sending over the C-Bus network.
-
static
-
class
cbus.protocol.application.lighting.
LightingTerminateRampSAL
(group_address: int)¶ Bases:
cbus.protocol.application.lighting.LightingSAL
Lighting terminate ramp event SAL
Instructs the given group address to discontinue any ramp operations in progress, and use the brightness that they are currently at.
This should not be called directly by your code!
Use one of the subclasses of cbus.protocol.lighting.LightingSAL instead.
-
static
decode
(data: bytes, command_code: int, group_address: int) → Tuple[cbus.protocol.application.lighting.LightingTerminateRampSAL, bytes]¶ Do not call this method directly – use LightingSAL.decode
-
encode
()¶ Encodes the SAL into a format for sending over the C-Bus network.
-
static