mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-06-06 13:30:41 +02:00
adds docstring to DeviceConnection
This commit is contained in:
parent
04d19a853f
commit
ae9761bd11
@ -5,6 +5,25 @@ import pydase
|
|||||||
|
|
||||||
|
|
||||||
class DeviceConnection(pydase.DataService, ABC):
|
class DeviceConnection(pydase.DataService, ABC):
|
||||||
|
"""
|
||||||
|
Abstract base class for device connection management in the pydase framework.
|
||||||
|
|
||||||
|
This class forms the foundation for subclasses that manage connections to specific
|
||||||
|
devices. Implementers are required to define the `connect()` method and the
|
||||||
|
`connected` property. The `connect()` method should handle the logic to establish a
|
||||||
|
connection with the device, while the `connected` property should return the current
|
||||||
|
connection status.
|
||||||
|
|
||||||
|
An instance of this class automatically starts a task that periodically checks the
|
||||||
|
device's availability and attempts reconnection if necessary.
|
||||||
|
|
||||||
|
In the frontend, this class is represented without directly exposing the `connect`
|
||||||
|
method and `connected` attribute. Instead, it displays user-defined attributes,
|
||||||
|
methods, and properties. When the device connection is not established, the frontend
|
||||||
|
component is overlaid, allowing manual triggering of the `connect()` method. The
|
||||||
|
overlay disappears once the connection is re-established.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self._autostart_tasks = {"_handle_connection": ()} # type: ignore
|
self._autostart_tasks = {"_handle_connection": ()} # type: ignore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user