mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 22:28:48 +00:00
Fix: Peanut widget v2 api compatibility (#2526)
This commit is contained in:
parent
32f28d32dd
commit
ccad62b5c2
1 changed files with 11 additions and 0 deletions
|
@ -24,6 +24,17 @@ export default function Component({ service }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// backwards compatibility with peanut v1
|
||||||
|
if ("battery.charge" in upsData) {
|
||||||
|
upsData.battery_charge = upsData["battery.charge"];
|
||||||
|
}
|
||||||
|
if ("ups.load" in upsData) {
|
||||||
|
upsData.ups_load = upsData["ups.load"];
|
||||||
|
}
|
||||||
|
if ("ups.status" in upsData) {
|
||||||
|
upsData.ups_status = upsData["ups.status"];
|
||||||
|
}
|
||||||
|
|
||||||
let status;
|
let status;
|
||||||
switch (upsData.ups_status) {
|
switch (upsData.ups_status) {
|
||||||
case "OL":
|
case "OL":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue