Can set relay forced state from UI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-29 17:49:03 +01:00
parent 88a24565b4
commit abdca20a66
6 changed files with 178 additions and 10 deletions

View File

@@ -16,12 +16,13 @@ import React from "react";
import { useNavigate } from "react-router-dom";
import { Device, DeviceApi, DeviceRelay, DeviceURL } from "../api/DeviceApi";
import { RelayApi, RelaysStatus } from "../api/RelayApi";
import { ServerApi } from "../api/ServerApi";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { BoolText } from "../widgets/BoolText";
import { CopyToClipboard } from "../widgets/CopyToClipboard";
import { RelayForcedState } from "../widgets/RelayForcedState";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { TimeWidget } from "../widgets/TimeWidget";
import { CopyToClipboard } from "../widgets/CopyToClipboard";
import { ServerApi } from "../api/ServerApi";
export function RelaysListRoute(p: {
homeWidget?: boolean;
@@ -104,6 +105,7 @@ function RelaysList(p: {
<TableCell>Priority</TableCell>
<TableCell>Consumption</TableCell>
<TableCell>Status</TableCell>
<TableCell>Forced state</TableCell>
<TableCell></TableCell>
</TableRow>
</TableHead>
@@ -129,6 +131,13 @@ function RelaysList(p: {
/>{" "}
for <TimeWidget diff time={p.status.get(row.id)!.for} />
</TableCell>
<TableCell>
<RelayForcedState
relay={row}
state={p.status.get(row.id)!}
onUpdated={p.onReload}
/>
</TableCell>
<TableCell>
<Tooltip title="Copy legacy api status">
<CopyToClipboard