git-kick / ioBroker.e3dc-rscp

Manage E3/DC power station based on RSCP
GNU General Public License v3.0
26 stars 10 forks source link

Preserve new items when importing adapter config from *.json #204

Open git-kick opened 1 year ago

git-kick commented 1 year ago

Currently, the adapter relies on the standard *.json import function offered in the configuration dialogue.

Often, new e3dc-rscp versions add new config items, e.g. additional request tags in the "Polling Intervals" list. After importing an oolder .json to such new version, the new items disappear. It seems like the json-import replaces the whole config instead of writing values from .json to the current config.

The behaviour described above lead to siginficant trouble, see #196

Dod: the config *.json import is implemented so that

  1. it writes the values from .json to the adapter config for all items which are existing in both .json and adapter config,
  2. it preserves items in the new adapter config which are nonexistent in the *.json,
  3. it ignores items in the *.json which are nonexistent in the adapter config.

First step is an investigation about the right place to implement, e.g.