@riddix/hamh 2.1.0-alpha.495 → 2.1.0-alpha.497
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/backend/cli.js
CHANGED
|
@@ -176304,10 +176304,14 @@ var VacuumPowerSourceServer = PowerSourceServer2({
|
|
|
176304
176304
|
}
|
|
176305
176305
|
const attributes7 = entity.attributes;
|
|
176306
176306
|
const batteryLevel = attributes7.battery_level ?? attributes7.battery;
|
|
176307
|
-
if (batteryLevel == null
|
|
176307
|
+
if (batteryLevel == null) {
|
|
176308
176308
|
return null;
|
|
176309
176309
|
}
|
|
176310
|
-
|
|
176310
|
+
if (typeof batteryLevel === "number") {
|
|
176311
|
+
return batteryLevel;
|
|
176312
|
+
}
|
|
176313
|
+
const parsed = Number.parseFloat(String(batteryLevel));
|
|
176314
|
+
return Number.isNaN(parsed) ? null : parsed;
|
|
176311
176315
|
},
|
|
176312
176316
|
isCharging(entity) {
|
|
176313
176317
|
const state = entity.state;
|