Get state of relay on device page
This commit is contained in:
@@ -14,6 +14,7 @@ import React from "react";
|
||||
import { DeviceRelay } from "../api/DeviceApi";
|
||||
import { RelayApi, RelaysStatus } from "../api/RelayApi";
|
||||
import { AsyncWidget } from "../widgets/AsyncWidget";
|
||||
import { BoolText } from "../widgets/BoolText";
|
||||
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
|
||||
import { TimeWidget } from "../widgets/TimeWidget";
|
||||
|
||||
@@ -103,15 +104,3 @@ function RelaysList(p: {
|
||||
</TableContainer>
|
||||
);
|
||||
}
|
||||
|
||||
function BoolText(p: {
|
||||
val: boolean;
|
||||
positive: string;
|
||||
negative: string;
|
||||
}): React.ReactElement {
|
||||
return p.val ? (
|
||||
<span style={{ color: "green" }}>{p.positive}</span>
|
||||
) : (
|
||||
<span style={{ color: "red" }}>{p.negative}</span>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user