Commit 18d968b
committed
feat(eu-data-act): json2iob descriptions + states maps from data dictionary
Two new generated files in lib/ are passed to json2iob.parse() as the
descriptions and states options:
- lib/euDataActDescriptions.json (500 entries)
Maps each dataFieldName leaf (e.g. "soc") to the human-readable text from
the EU Data Act PDF data dictionary. json2iob uses these as the
common.name of the corresponding ioBroker state, so the admin UI now
shows "State of Charging when charging is started" instead of "soc".
- lib/euDataActStates.json (33 enum leafs)
Maps each enum field's raw values (e.g. CHARGE_STATE_CHARGING_HV_BATTERY)
to a pretty label ("Charging Hv Battery"). json2iob renders the dropdown
for the state from this. The common prefix shared by all members of one
leaf is stripped before pretty-casing, so e.g. WINDOW_HEATING_STATE_OFF
appears as just "Off".
Both maps are derived from lib/euDataActDictionary.json (already shipped,
parsed upstream from the PDF). The reproducible derivation lives in
tools/buildEuDataActMaps.js. tools/ is dev-only; not included in the npm
package files glob.1 parent 952409f commit 18d968b
4 files changed
Lines changed: 860 additions & 0 deletions
0 commit comments