Skip to content

Commit ccc30b8

Browse files
committed
web: TacComponents: add a notification in case of IOBus overload
Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent 1c577de commit ccc30b8

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

web/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import "./App.css";
3131
import { useMqttSubscription } from "./mqtt";
3232
import { ApiPickerButton, MqttButton } from "./MqttComponents";
3333
import {
34+
IOBusFaultNotification,
3435
RebootNotification,
3536
UpdateNotification,
3637
ProgressNotification,
@@ -158,6 +159,7 @@ function Notifications() {
158159
<ProgressNotification />
159160
<UpdateNotification />
160161
<LocatorNotification />
162+
<IOBusFaultNotification />
161163
</>
162164
);
163165
}

web/src/TacComponents.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,19 @@ export function LocatorNotification() {
487487
</Alert>
488488
);
489489
}
490+
491+
export function IOBusFaultNotification() {
492+
const overload = useMqttSubscription<boolean>("/v1/iobus/feedback/fault");
493+
494+
return (
495+
<Alert
496+
statusIconAriaLabel="Warning"
497+
type="warning"
498+
visible={overload === true}
499+
header="The IOBus power supply is overloaded"
500+
>
501+
The power supply on the IOBus connector is either shorted or overloaded by
502+
too many devices on the bus.
503+
</Alert>
504+
);
505+
}

0 commit comments

Comments
 (0)