renaming available to connected

This commit is contained in:
Mose Müller 2024-01-16 16:46:25 +01:00
parent fc28b83bc5
commit 04d19a853f
11 changed files with 21 additions and 21 deletions

View File

@ -22,8 +22,8 @@ export const DeviceConnectionComponent = React.memo(
isInstantUpdate, isInstantUpdate,
addNotification addNotification
}: DeviceConnectionProps) => { }: DeviceConnectionProps) => {
const { available, connect, ...updatedProps } = props; const { connected, connect, ...updatedProps } = props;
const availableVal = available.value; const connectedVal = connected.value;
let fullAccessPath = parentPath; let fullAccessPath = parentPath;
if (name) { if (name) {
@ -40,7 +40,7 @@ export const DeviceConnectionComponent = React.memo(
return ( return (
<div className="deviceConnectionComponent" id={id}> <div className="deviceConnectionComponent" id={id}>
{!availableVal && ( {!connectedVal && (
<div className="overlayContent"> <div className="overlayContent">
<div>{displayName} is currently not available!</div> <div>{displayName} is currently not available!</div>
<MethodComponent <MethodComponent

View File

@ -17,13 +17,13 @@ class DeviceConnection(pydase.DataService, ABC):
@property @property
@abstractmethod @abstractmethod
def available(self) -> bool: def connected(self) -> bool:
"""Checks if the abstracted device is available.""" """Checks if the abstracted device is connected."""
... ...
async def _handle_connection(self) -> None: async def _handle_connection(self) -> None:
"""Tries reconnecting to the device if it is not available.""" """Tries reconnecting to the device if it is not connected."""
while True: while True:
if not self.available: if not self.connected:
self.connect() self.connect()
await asyncio.sleep(self._handle_connection_wait_time) await asyncio.sleep(self._handle_connection_wait_time)

View File

@ -1,13 +1,13 @@
{ {
"files": { "files": {
"main.css": "/static/css/main.9cd75465.css", "main.css": "/static/css/main.a3b6fd1f.css",
"main.js": "/static/js/main.0105dbc5.js", "main.js": "/static/js/main.b13c9e72.js",
"index.html": "/index.html", "index.html": "/index.html",
"main.9cd75465.css.map": "/static/css/main.9cd75465.css.map", "main.a3b6fd1f.css.map": "/static/css/main.a3b6fd1f.css.map",
"main.0105dbc5.js.map": "/static/js/main.0105dbc5.js.map" "main.b13c9e72.js.map": "/static/js/main.b13c9e72.js.map"
}, },
"entrypoints": [ "entrypoints": [
"static/css/main.9cd75465.css", "static/css/main.a3b6fd1f.css",
"static/js/main.0105dbc5.js" "static/js/main.b13c9e72.js"
] ]
} }

View File

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.0105dbc5.js"></script><link href="/static/css/main.9cd75465.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site displaying a pydase UI."/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>pydase App</title><script defer="defer" src="/static/js/main.b13c9e72.js"></script><link href="/static/css/main.a3b6fd1f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long