class documentation
class UaVariableContainer(UaObject, ParentMixin[
Known subclasses: server.ua_variable_containers.Attributes, server.ua_variable_containers.FinalResultData, server.ua_variable_containers.Identification, server.ua_variable_containers.Monitoring, server.ua_variable_containers.ParameterSet
Constructor: UaVariableContainer(name, minimum_access_level, writable, **kwargs)
Base class for UaVariable containers. Also provides a Pythonic container interface.
| Method | __contains__ |
Whether a variable with given name exists in this container. |
| Method | __getitem__ |
Get a UaVariable by the given name. |
| Method | __init__ |
Cooperative constructor. |
| Method | __iter__ |
Iterate over the contained UaVariable. |
| Method | __len__ |
Return the number of contained UaVariable. |
| Async Method | add |
Add the given variable to the container. Can be used to add existing variables to other containers. |
| Async Method | read |
Read all contained variables and return a mapping from variable name to value. |
| Async Method | reset |
Reset all contained UaVariable to their initial value. |
| Async Method | write |
Write to all given mapping of variables name and their values. |
| Method | _check |
Check we have all required existing variables based on annotations. |
| Async Method | _init |
Undocumented |
| Async Method | _lifecycle |
Undocumented |
def __init__(self, *, name:
str, minimum_access_level: int | None = None, writable: bool = False, **kwargs):
¶
overridden in
server.ua_variable_containers.Attributes, server.ua_variable_containers.FinalResultData, server.ua_variable_containers.Identification, server.ua_variable_containers.Monitoring, server.ua_variable_containers.ParameterSetCooperative constructor.
| Parameters | |
name:str | The name of the container. |
minimumint | None | The minimum access level of the container. |
writable:bool | Whether the all UaVariable of this container have external OPC UA write access. |
| **kwargs | Undocumented |
async def add(self, variable:
UaVariable, *, exist_ok: bool = False, remove_existing: bool = False):
¶
Add the given variable to the container. Can be used to add existing variables to other containers.
If the variable is not initialized yet, it will be initialized with this container as parent.
| Parameters | |
variable:UaVariable | UaVariable to add to the container. |
existbool | Whether to reuse an existing OPC UA variable node if found during initialization. |
removebool | Whether to remove existing OPC UA variable node if found during initialization. |
Write to all given mapping of variables name and their values.
| Raises | |
KeyError | If no variable with given name in mapping exists. |
OutOfRangeError | if value of mapping is not within the range of the corresponding variable. |