pyg90alarm.local.system_cmd
Provides support for system commands of the G90 alarm panel.
Classes
|
Sets the server address for the panel to communicate with using the cloud notifications protocol. |
|
Represents a system command of the G90 alarm panel. |
|
Base class for system commands of the G90 alarm panel. |
|
Represents a system configuration command of the G90 alarm panel. |
- class pyg90alarm.local.system_cmd.G90SystemCommandBase(*, code, **kwargs)
Bases:
G90Command[SystemCommandsT,SystemCommandsDataT]Base class for system commands of the G90 alarm panel.
- Parameters:
code (
TypeVar(SystemCommandsT, bound=G90SystemCommands)) – System command codekwargs (
Any) – Additional arguments passed to the base class
- property expects_response: bool
Indicates whether the command expects a response.
System commands do not return any response.
- Returns:
False
- encode_data(data)
Encodes the command data to string.
- decode_data(payload)
Decodes the command data from string.
- to_wire()
Serializes the command to wire format as expected by the panel.
- Return type:
- Returns:
Wire data
- from_wire(data)
Deserializes the command from wire format.
- property result: SystemCommandsDataT
The result of the command.
- Returns:
Decoded data
- pause_writing()
Called when the transport’s buffer goes over the high-water mark.
Pause and resume calls are paired – pause_writing() is called once when the buffer goes strictly over the high-water mark (even if subsequent writes increases the buffer size even more), and eventually resume_writing() is called once when the buffer size reaches the low-water mark.
Note that if the buffer size equals the high-water mark, pause_writing() is not called – it must go strictly over. Conversely, resume_writing() is called when the buffer size is equal or lower than the low-water mark. These end conditions are important to ensure that things go as expected when either mark is zero.
NOTE: This is the only Protocol callback that is not called through EventLoop.call_soon() – if it were, it would have no effect when it’s most needed (when the app keeps writing without yielding until pause_writing() is called).
- async process()
Processes the command.
- Return type:
Self
- resume_writing()
Called when the transport’s buffer drains below the low-water mark.
See pause_writing() for details.
- class pyg90alarm.local.system_cmd.G90SystemCommand(*, code, **kwargs)
Bases:
G90SystemCommandBase[SystemCommandsT,str]Represents a system command of the G90 alarm panel.
- Parameters:
code (
TypeVar(SystemCommandsT, bound=G90SystemCommands)) – System command codekwargs (
Any) – Additional arguments passed to the base class
- encode_data(data)
Encodes the command data to string.
- decode_data(payload)
Decodes the command data from string.
No response is expected for system commands.
- from_wire(data)
Deserializes the command from wire format.
No response is expected for system commands.
- property result: str
The result of the command.
No response is expected for system commands.
- Returns:
Empty string
- property expects_response: bool
Indicates whether the command expects a response.
System commands do not return any response.
- Returns:
False
- pause_writing()
Called when the transport’s buffer goes over the high-water mark.
Pause and resume calls are paired – pause_writing() is called once when the buffer goes strictly over the high-water mark (even if subsequent writes increases the buffer size even more), and eventually resume_writing() is called once when the buffer size reaches the low-water mark.
Note that if the buffer size equals the high-water mark, pause_writing() is not called – it must go strictly over. Conversely, resume_writing() is called when the buffer size is equal or lower than the low-water mark. These end conditions are important to ensure that things go as expected when either mark is zero.
NOTE: This is the only Protocol callback that is not called through EventLoop.call_soon() – if it were, it would have no effect when it’s most needed (when the app keeps writing without yielding until pause_writing() is called).
- async process()
Processes the command.
- Return type:
Self
- resume_writing()
Called when the transport’s buffer drains below the low-water mark.
See pause_writing() for details.
- class pyg90alarm.local.system_cmd.G90SystemConfigurationCommand(*, cmd, data=None, **kwargs)
Bases:
G90SystemCommandBase[G90SystemCommands,List[str]]Represents a system configuration command of the G90 alarm panel.
- Parameters:
cmd (
G90SystemConfigurationCommands) – Sub-command code for configuration commandkwargs (
Any) – Additional arguments passed to the base class
- encode_data(data)
Encodes the command data to string.
- decode_data(payload)
Decodes the command data from string.
System configuration commands do not return any response.
- from_wire(data)
Deserializes the command from wire format.
System configuration commands do not return any response.
- property result: List[str]
The result of the command.
System configuration commands do not return any response.
- Returns:
Empty list
- property expects_response: bool
Indicates whether the command expects a response.
System commands do not return any response.
- Returns:
False
- pause_writing()
Called when the transport’s buffer goes over the high-water mark.
Pause and resume calls are paired – pause_writing() is called once when the buffer goes strictly over the high-water mark (even if subsequent writes increases the buffer size even more), and eventually resume_writing() is called once when the buffer size reaches the low-water mark.
Note that if the buffer size equals the high-water mark, pause_writing() is not called – it must go strictly over. Conversely, resume_writing() is called when the buffer size is equal or lower than the low-water mark. These end conditions are important to ensure that things go as expected when either mark is zero.
NOTE: This is the only Protocol callback that is not called through EventLoop.call_soon() – if it were, it would have no effect when it’s most needed (when the app keeps writing without yielding until pause_writing() is called).
- async process()
Processes the command.
- Return type:
Self
- resume_writing()
Called when the transport’s buffer drains below the low-water mark.
See pause_writing() for details.
- class pyg90alarm.local.system_cmd.G90SetServerAddressCommand(*, cloud_ip, cloud_port, **kwargs)
Bases:
G90SystemConfigurationCommandSets the server address for the panel to communicate with using the cloud notifications protocol.
- Parameters:
- decode_data(payload)
Decodes the command data from string.
System configuration commands do not return any response.
- encode_data(data)
Encodes the command data to string.
- property expects_response: bool
Indicates whether the command expects a response.
System commands do not return any response.
- Returns:
False
- from_wire(data)
Deserializes the command from wire format.
System configuration commands do not return any response.
- pause_writing()
Called when the transport’s buffer goes over the high-water mark.
Pause and resume calls are paired – pause_writing() is called once when the buffer goes strictly over the high-water mark (even if subsequent writes increases the buffer size even more), and eventually resume_writing() is called once when the buffer size reaches the low-water mark.
Note that if the buffer size equals the high-water mark, pause_writing() is not called – it must go strictly over. Conversely, resume_writing() is called when the buffer size is equal or lower than the low-water mark. These end conditions are important to ensure that things go as expected when either mark is zero.
NOTE: This is the only Protocol callback that is not called through EventLoop.call_soon() – if it were, it would have no effect when it’s most needed (when the app keeps writing without yielding until pause_writing() is called).
- async process()
Processes the command.
- Return type:
Self
- property result: List[str]
The result of the command.
System configuration commands do not return any response.
- Returns:
Empty list
- resume_writing()
Called when the transport’s buffer drains below the low-water mark.
See pause_writing() for details.