Hi all,
i have define a global file store to store some values permanent - wen NR runs i find the json file with the pre-defined values in ./context/global:
cat global.json
{
"Bad": {
"Akku": {
"Min": 20,
"Max": 70,
"Load": false
}
},
"Buero": {
"Akku": {
"Min": 20,
"Max": 70,
"Load": false
}
},
"Schlafzimmer": {
"Akku": {
"Min": 20,
"Max": 70,
"Load": false
}
}
if i store one value e.g. "Bad.Akku.Min" in a function like this:
var Bad=global.get('Bad') || {};
Bad.Akku.Min=10;
global.set('Bad',Bad);
30 sec later the cat global.json:
cat global.json
{
"Bad": {
"Akku": {
"Min": 10,
"Max": 70,
"Load": false
}
},
"Buero": {
"Akku": {
"Min": 10,
"Max": 70,
"Load": false
}
},
"Schlafzimmer": {
"Akku": {
"Min": 10,
"Max": 70,
"Load": false
}
}
ALL "Min" values are changed to "10" - not only the "Bad.Akku.Min"
What's going wrong there?
Thanks
Hubertus