scsgate package¶
Subpackages¶
Submodules¶
scsgate.connection module¶
This module contains an helper class to initiate a connection with the SCSGate device
scsgate.messages module¶
This module contains the definition of all the messages known by SCSGate
-
class
scsgate.messages.
AckMessage
[source]¶ Bases:
scsgate.messages.SCSMessage
Ack message
-
class
scsgate.messages.
CommandMessage
(data)[source]¶ Bases:
scsgate.messages.SCSMessage
Message issued to turn on/off a switch
-
destination
¶ The target of the message
-
entity
¶ The ID of the subject of this message
-
source
¶ The source of the message
-
status
¶ Current status
-
-
class
scsgate.messages.
RequestStatusMessage
(data)[source]¶ Bases:
scsgate.messages.SCSMessage
Message sent to request the status of a switch
-
destination
¶ The target of the message
-
entity
¶ The ID of the subject of this message
-
source
¶ The source of the message
-
-
class
scsgate.messages.
SCSMessage
(data)[source]¶ Bases:
object
Base class for all SCS messages
-
bytes
¶ A list containing all the bytes of the message
-
data
¶ The raw message
-
entity
¶ The ID of the subject of this message
-
-
class
scsgate.messages.
ScenarioTriggeredMessage
(data)[source]¶ Bases:
scsgate.messages.SCSMessage
Message issued when a scenario switch is pressed
-
entity
¶ The ID of the subject of this message
-
scenario
¶ The scenario ID
-
source
¶ The source of the message
-
-
class
scsgate.messages.
StateMessage
(data)[source]¶ Bases:
scsgate.messages.SCSMessage
Message issued to notify a change of state
-
entity
¶ The ID of the subject of this message
-
source
¶ The source of the message
-
status
¶ Current status
-
toggled
¶ True if the light is toggled, False otherwise
-
-
class
scsgate.messages.
UnknownMessage
(data)[source]¶ Bases:
scsgate.messages.SCSMessage
Message unknown
-
scsgate.messages.
checksum_bytes
(data)[source]¶ Returns a XOR of all the bytes specified inside of the given list
scsgate.reactor module¶
This module contains the definition of the Reactor class. This one is useful when dealing with concurrent access to the SCSGate device
-
class
scsgate.reactor.
Reactor
(connection, handle_message, logger=None)[source]¶ Bases:
threading.Thread
Allows concurrent access to the SCSGate device
scsgate.tasks module¶
This module contains all the possible messages to send via scsgate.Reactor
-
exception
scsgate.tasks.
ExecutionError
[source]¶ Bases:
BaseException
Error raised when something goes wrong while executing a task
-
class
scsgate.tasks.
GetStatusTask
(target)[source]¶ Bases:
scsgate.tasks.BasicTask
Requests the current status of a device
-
class
scsgate.tasks.
HaltRollerShutterTask
(target)[source]¶ Bases:
scsgate.tasks.SetStatusTask
Halt a roller shutter
-
class
scsgate.tasks.
LowerRollerShutterTask
(target)[source]¶ Bases:
scsgate.tasks.SetStatusTask
Lower a roller shutter
-
class
scsgate.tasks.
MonitorTask
(notification_endpoint)[source]¶ Bases:
scsgate.tasks.BasicTask
Read the buffer and invokes the notification endpoint if there’s a relevant message
-
class
scsgate.tasks.
RaiseRollerShutterTask
(target)[source]¶ Bases:
scsgate.tasks.SetStatusTask
Raise a roller shutter
-
class
scsgate.tasks.
SetStatusTask
(target, action)[source]¶ Bases:
scsgate.tasks.BasicTask
Generic task to request a status change. To not be used directly
-
class
scsgate.tasks.
ToggleStatusTask
(target, toggled)[source]¶ Bases:
scsgate.tasks.SetStatusTask
Change the toggled status of a light or switch