Skip to content

Commit f9fd3c7

Browse files
committed
web: add over temperature notification
Notify the user if their TAC is overheating. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent 05837ea commit f9fd3c7

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

web/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
UpdateNotification,
3737
ProgressNotification,
3838
LocatorNotification,
39+
OverTemperatureNotification,
3940
} from "./TacComponents";
4041

4142
function Navigation() {
@@ -156,6 +157,7 @@ function Notifications() {
156157
<>
157158
<ConnectionNotification />
158159
<RebootNotification />
160+
<OverTemperatureNotification />
159161
<ProgressNotification />
160162
<UpdateNotification />
161163
<LocatorNotification />

web/src/TacComponents.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,3 +503,20 @@ export function IOBusFaultNotification() {
503503
</Alert>
504504
);
505505
}
506+
507+
export function OverTemperatureNotification() {
508+
const warning = useMqttSubscription<string>("/v1/tac/temperatures/warning");
509+
510+
return (
511+
<Alert
512+
statusIconAriaLabel="Warning"
513+
type="warning"
514+
visible={warning !== null && warning !== "Okay"}
515+
header="Your LXA TAC is overheating"
516+
>
517+
The LXA TAC's temperature is{" "}
518+
{warning === "SocCritical" ? "critical" : "high"}. Provide better airflow
519+
and check for overloads!
520+
</Alert>
521+
);
522+
}

0 commit comments

Comments
 (0)