HSL 2.0 framework
Description of the framework
|
Base class for a HSL 2.0 block More..
Public Member Functions | |
def | __init__ (self, homeserver_context, module_context) |
Construct, must be called in the constructor of the inherited class. More... | |
def | on_input_value (self, index, value) |
Called each time a value arrives at an input of the block. More... | |
def | on_init (self) |
Is called once when the block is initialised. More... | |
Private Member Functions | |
def | _get_module_id (self) |
Returns the runtime ID of the module. More... | |
def | _get_module_class_id (self) |
Returns the five-digit block ID (for example '10001'). More... | |
def | _get_framework (self) |
Returns an object of type hsl20_4.framework. More... | |
def | _get_logger (self, logType, param) |
Returns an object of the type hsl20_4.Logger More... | |
def | _get_input_value (self, index) |
Returns the value that was at the time of the call at input index is present, back. More... | |
def | _set_output_value (self, index, value) |
Sets a value to an output. More... | |
def | _can_set_output (self) |
Indicates whether a value can be set to an output. More... | |
def | _get_remanent (self, index) |
Returns the value of the remanent variable. More... | |
def | _set_remanent (self, index, value) |
Describes a remanent variable. More... | |
Basic class for an HSL 2.0 device
An HSL 2.0 device must have this class as its base by inheritance. The generator generates the necessary code segments: An example of the implementation of the block lock is enclosed: 10701_MyBaseModule_03.py
def hsl20_4.hsl20_4.BaseModule.__init__ | ( | self, | |
homeserver_context, | |||
module_context | |||
) |
Construct, must be called in the constructor of the inherited class
homeserver_context | object Reference to the HomeServer object structure |
module_context | string Key of the module context. The key determines the context in which the module runs |
|
private |
Indicates whether a value can be set to an output
Returns False if no further value can be written at first.
|
private |
Returns an object of the type hsl20_4.Framework
|
private |
Returns the value that was set at input
index is present, back
The value applied to the input can change during the execution of the block logic
index | int Index of the input |
|
private |
Returns an object of the type hsl20_4.Logger
logType | int Logging handler (e.g. hsl20_4.LOGGING_SYSLOG) |
param | tuple Parameters for the logging handler used |
|
private |
Returns the five-digit block ID (for example '10001')
|
private |
Returns the runtime ID of the module
The ID is only valid during the runtime of the device.
|
private |
Returns the value of the remanent variable
See also the documentation on the remanent storage.
index | int Index of the remanent variable |
|
private |
Sets a value to an output
index | int Index of the output to be written |
value | float/str Value that is written to the output. The data type depends on whether the output is defined as numeric or alphanumeric |
|
private |
Describes a remanent variable
See also the documentation on the remote memory.
index | int Index of the remanent variable |
value | float/str Value of the remanent variable (maximum size: 30,000 bytes) |
def hsl20_4.hsl20_4.BaseModule.on_init | ( | self | ) |
Is called once when the block is initialised
This method can be implemented (overwritten) when a block is created
def hsl20_4.hsl20_4.BaseModule.on_input_value | ( | self, | |
index, | |||
value | |||
) |
Called each time a value arrives at an input of the block
The method is called exactly once for each arrival of a value at an input.
This method must be implemented (overwritten) when a block is created
index | int Index of the input |
value | float/str Value that has arrived at the input. The data type depends on whether the input is defined as numeric or alphanumeric |