@rfranzoi/scrypted-mqtt-securitysystem 1.0.55 → 1.0.56
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/main.nodejs.js +10 -7
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
package/dist/main.nodejs.js
CHANGED
|
@@ -34180,14 +34180,17 @@ class BaseMqttSensor extends sdk_1.ScryptedDeviceBase {
|
|
|
34180
34180
|
np === 'battery_low' ||
|
|
34181
34181
|
truthy(np);
|
|
34182
34182
|
this.lowBattery = isLow;
|
|
34183
|
-
|
|
34184
|
-
|
|
34185
|
-
|
|
34186
|
-
|
|
34187
|
-
|
|
34188
|
-
|
|
34183
|
+
// Simula anche la percentuale per HomeKit/Scrypted:
|
|
34184
|
+
// low -> 10%
|
|
34185
|
+
// ok -> 100%
|
|
34186
|
+
const level = isLow ? 10 : 100;
|
|
34187
|
+
this.setAndEmit('batteryLevel', level, sdk_1.ScryptedInterface.Battery, {
|
|
34188
|
+
topic,
|
|
34189
|
+
raw,
|
|
34190
|
+
propLabel: 'batteryLevel(from lowBattery)',
|
|
34191
|
+
});
|
|
34189
34192
|
if (RUNTIME.logSensors) {
|
|
34190
|
-
this.console?.log?.(`[Sensor] ${this.cfg.name} [${this.cfg.id}] lowBattery -> ${isLow} (${topic}="${raw}")`);
|
|
34193
|
+
this.console?.log?.(`[Sensor] ${this.cfg.name} [${this.cfg.id}] lowBattery -> ${isLow}, level -> ${level} (${topic}="${raw}")`);
|
|
34191
34194
|
}
|
|
34192
34195
|
return;
|
|
34193
34196
|
}
|
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED