Skip to content

Commit

Permalink
Small fix to retain Manual KVS mode after script update
Browse files Browse the repository at this point in the history
  • Loading branch information
LeivoSepp committed Feb 4, 2025
1 parent 253a436 commit 5a3092d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions ShellyLiveTariff.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let _ = {
sId: Shelly.getCurrentScriptId(),
pId: "Id" + Shelly.getCurrentScriptId() + ": ",
prov: "None",
newV: 1.2,
newV: 1.3,
cdOk: false, //configuration data OK
sdOk: false, //system data OK
};
Expand Down Expand Up @@ -139,6 +139,7 @@ function memC(dt) {
c.api = dt.API;
c.pack = dt.EnergyProvider;
c.cnty = dt.Country;
c.mnKv = typeof dt.ManualKVS === "boolean" ? dt.ManualKVS : c.mnKv;
return c;
}
// ConfigurationData data to KVS store
Expand All @@ -147,6 +148,7 @@ function kvsC() {
cdat.API = c.api;
cdat.EnergyProvider = c.pack;
cdat.Country = c.cnty;
cdat.ManualKVS = c.mnKv;
return cdat;
}
// Get KVS SystemData into memory
Expand Down Expand Up @@ -198,13 +200,8 @@ function inst() {
gVc();
}
} else {
if (_.cdOk && _.sdOk) {
print(_.pId, "Existing KVS mode");
main();
} else {
print(_.pId, "New KVS mode installation");
tKvs();
}
print(_.pId, "Script in KVS mode");
tKvs();
}
}
// Store configuration data to KVS
Expand Down

0 comments on commit 5a3092d

Please sign in to comment.