diff --git a/central_backend/src/energy/engine.rs b/central_backend/src/energy/engine.rs
index b1b7ab8..8cec247 100644
--- a/central_backend/src/energy/engine.rs
+++ b/central_backend/src/energy/engine.rs
@@ -140,7 +140,7 @@ impl EnergyEngine {
// Forcefully turn off disabled relays
for d in devices {
for r in &d.relays {
- if !r.enabled {
+ if !r.enabled || !d.enabled {
new_relays_state.get_mut(&r.id).unwrap().on = false;
}
}
diff --git a/central_frontend/src/routes/RelaysListRoute.tsx b/central_frontend/src/routes/RelaysListRoute.tsx
index ddbb14c..1c297bf 100644
--- a/central_frontend/src/routes/RelaysListRoute.tsx
+++ b/central_frontend/src/routes/RelaysListRoute.tsx
@@ -1,5 +1,3 @@
-import CheckIcon from "@mui/icons-material/Check";
-import DeleteIcon from "@mui/icons-material/Delete";
import RefreshIcon from "@mui/icons-material/Refresh";
import {
IconButton,
@@ -13,15 +11,10 @@ import {
Tooltip,
} from "@mui/material";
import React from "react";
-import { Device, DeviceApi, DeviceRelay } from "../api/DeviceApi";
-import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
-import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
-import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
-import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
+import { DeviceRelay } from "../api/DeviceApi";
+import { RelayApi } from "../api/RelayApi";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
-import { TimeWidget } from "../widgets/TimeWidget";
-import { RelayApi } from "../api/RelayApi";
export function RelaysListRoute(): React.ReactElement {
const loadKey = React.useRef(1);
@@ -84,7 +77,13 @@ function RelaysList(p: {
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
>
{row.name}
- {row.enabled ? "YES" : "NO"}
+
+ {row.enabled ? (
+ YES
+ ) : (
+ NO
+ )}
+
{row.priority}
{row.consumption}
TODO