sunspec / pysunspec2

SunSpec Python library for interfacing with SunSpec devices.
Apache License 2.0
57 stars 21 forks source link

Provide symbols info in model def #75

Open CoRfr opened 1 year ago

CoRfr commented 1 year ago

The dict provided by smdx.from_smdx didn't include all the info provided in the SMDX for symbols, and instead just contained name & value.

Going through all the smdx string/symbols elements to collect info, and assigning that to matching symbol definitions.

This is a symbol before:

        "symbols": [
          {
            "name": "IEEE_1547",
            "value": 0
          },

and after:

        "symbols": [
          {
            "name": "IEEE_1547",
            "value": 0,
            "label": "IEEE 1547 (default)",
            "desc": "'IEEE 1547' is the most common inverter compliance setting."
          },

Most SMDX files do not provide additional symbol info and are therefore not affected.