Skip to content

Commit 5a3092d

Browse files
committed
Small fix to retain Manual KVS mode after script update
1 parent 253a436 commit 5a3092d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ShellyLiveTariff.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ let _ = {
5454
sId: Shelly.getCurrentScriptId(),
5555
pId: "Id" + Shelly.getCurrentScriptId() + ": ",
5656
prov: "None",
57-
newV: 1.2,
57+
newV: 1.3,
5858
cdOk: false, //configuration data OK
5959
sdOk: false, //system data OK
6060
};
@@ -139,6 +139,7 @@ function memC(dt) {
139139
c.api = dt.API;
140140
c.pack = dt.EnergyProvider;
141141
c.cnty = dt.Country;
142+
c.mnKv = typeof dt.ManualKVS === "boolean" ? dt.ManualKVS : c.mnKv;
142143
return c;
143144
}
144145
// ConfigurationData data to KVS store
@@ -147,6 +148,7 @@ function kvsC() {
147148
cdat.API = c.api;
148149
cdat.EnergyProvider = c.pack;
149150
cdat.Country = c.cnty;
151+
cdat.ManualKVS = c.mnKv;
150152
return cdat;
151153
}
152154
// Get KVS SystemData into memory
@@ -198,13 +200,8 @@ function inst() {
198200
gVc();
199201
}
200202
} else {
201-
if (_.cdOk && _.sdOk) {
202-
print(_.pId, "Existing KVS mode");
203-
main();
204-
} else {
205-
print(_.pId, "New KVS mode installation");
206-
tKvs();
207-
}
203+
print(_.pId, "Script in KVS mode");
204+
tKvs();
208205
}
209206
}
210207
// Store configuration data to KVS

0 commit comments

Comments
 (0)