class documentation

class UaObject(BaseUaObject['Server'], LifecycleMixin, ReprStrMixin, AbstractUaObject):

Constructor: UaObject(name, minimum_access_level, bypass_lock, server, ...)

View In Hierarchy

Abstract base class for all server-side PyUaAdapter-managed OPC UA objects.

Method __init__ Cooperative constructor.
Method access_allowed Undocumented
Async Method ua_create_node Create main OPC UA node and all modeled mandatory sub nodes at the given OPC UA ua_location.
Instance Variable bypass_lock Whether Lock ownership can be bypassed.
Instance Variable minimum_access_level Minimum User access level required for write & method execution.
Instance Variable ua_node Undocumented
Property lock Lock instance protecting this UaObject.
Async Method _get_definition Return the instantiation definition for the main OPC UA node. Is called from ua_create_node.
Method _repr_items Undocumented
Async Method _ua_create_node Get the OPC UA object type and create a new object at the given OPC UA ua_location.
def __init__(self, *, name: str | None = None, minimum_access_level: int | None = None, bypass_lock: bool = False, server: Server | None = None, **kwargs: dict[str, Any]):

Cooperative constructor.

Parameters
name:str | NoneName of the UaObject. Must be a non-empty string or None to use the Python class name.
minimum_access_level:int | NoneMinimum access level of the UaObject (write/call). Read access is always allowed.
bypass_lock:boolWhether the variable can be written to without ownership of corresponding lock.
server:Server | NoneUndocumented
**kwargs:dict[str, Any]Undocumented
@override
def access_allowed(self, user: UserAuthorization, *, lock_required: bool | None = None) -> bool:

Undocumented

@final
async def ua_create_node(self, ua_location: Node, *, instantiate_optional: bool = False, exist_ok: bool = False, remove_existing: bool = False):

Create main OPC UA node and all modeled mandatory sub nodes at the given OPC UA ua_location.

If subclasses want to customize the node creation behavior, override _ua_create_node().

Parameters
ua_location:NodeParent OPC-UA node, ideally a folder type.
instantiate_optional:boolWhether to instantiate all modeled optional sub nodes as well.
exist_ok:boolWhether to reuse an existing node if found.
remove_existing:boolWhether to remove existing node if found.
Raises
RuntimeErrorIf main OPC UA node already set, or already exists and reusing is not allowed.
bypass_lock: bool =

Whether Lock ownership can be bypassed.

minimum_access_level: int =

Minimum User access level required for write & method execution.

ua_node =

Undocumented

@property
@override
lock: Lock =

Lock instance protecting this UaObject.

@abstractmethod
async def _get_definition(self) -> UaObjectDefinition:

Return the instantiation definition for the main OPC UA node. Is called from ua_create_node.

@override
def _repr_items(self) -> Iterator[tuple[str, object]]:

Undocumented

async def _ua_create_node(self, ua_location: Node, *, instantiate_optional: bool, exist_ok: bool, remove_existing: bool):

Get the OPC UA object type and create a new object at the given OPC UA ua_location.