added dynamic value on block

This commit is contained in:
Batuhan Şanlı 2023-09-26 13:03:05 +03:00
parent dd0ec52bab
commit f99b70273b

View File

@ -8,9 +8,9 @@ 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 && jobStats.state==="Offline") {
if (printerStatsError && jobStats) {
return <Container service={service}>
<Block label="octoprint.printer_state" value="Not Operational" />
<Block label="octoprint.printer_state" value={jobStats.state} />
</Container>
}