Feature: Added detect octoprint offline printer (#2068)

pull/2074/head
Batuhan Şanlı 1 year ago committed by GitHub
parent 024b912467
commit 588429c868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,12 @@ export default function Component({ service }) {
const { data: printerStats, error: printerStatsError } = useWidgetAPI(widget, "printer_stats");
const { data: jobStats, error: jobStatsError } = useWidgetAPI(widget, "job_stats");
if (printerStatsError && jobStats) {
return <Container service={service}>
<Block label="octoprint.printer_state" value={jobStats.state} />
</Container>
}
if (printerStatsError) {
return <Container service={service} error={printerStatsError} />;
}

Loading…
Cancel
Save