XKNX / xknxproject

ETS project parser written in python
GNU General Public License v2.0
81 stars 16 forks source link

Non-substituted template strings in texts #445

Open envy opened 3 weeks ago

envy commented 3 weeks ago

I just parsed my project file with HA 2024.08.2 and got this:

"1.0.13/MD-1_M-1_MI-1_O-2-0_R-7": {
        "name": "ECG 1, Switching",
        "number": 559,
        "text": "EVG {{ECG_NO}}, Schalten Flur",
        "function_text": "Ein/Aus",
        "description": "",
        "device_address": "1.0.13",
        "device_application": "M-0083_A-0153-10-297A-O00EF",
        "module_def": {
          "definition": "MD-1",
          "root_number": 0
        },
        "channel": null,
        "dpts": [
          {
            "main": 1,
            "sub": 1
          }
        ],
        "object_size": "1 Bit",
        "flags": {
          "read": false,
          "write": true,
          "communication": true,
          "update": false,
          "read_on_init": false,
          "transmit": false
        },
        "group_address_links": [
          "7/0/0",
          "30/0/0"
        ]
      },

The text key contains a non-substituted template string.

This did work before, here is the same entry from xknxproject v3.6.0:

"1.0.13/MD-1_M-1_MI-1_O-2-0_R-7": {
        "name": "ECG 1, Switching",
        "number": 559,
        "text": "EVG 1, Schalten Flur",
        "function_text": "Ein/Aus",
        "description": "",
        "device_address": "1.0.13",
        "device_application": "M-0083_A-0153-10-297A-O00EF",
        "module_def": {
          "definition": "MD-1",
          "root_number": 0
        },
        "channel": null,
        "dpts": [
          {
            "main": 1,
            "sub": 1
          }
        ],
        "object_size": "1 Bit",
        "flags": {
          "read": false,
          "write": true,
          "communication": true,
          "update": false,
          "read_on_init": false,
          "transmit": false
        },
        "group_address_links": [
          "7/0/0",
          "30/0/0"
        ]
      },
envy commented 3 weeks ago

I noticed this here and first thought it was a frontend bug:

grafik

farmio commented 3 weeks ago

Aha, that's awkward. What ETS version did create your project file?

envy commented 3 weeks ago

ETS 5.7.7 I think.

"tool_version": "5.7.1428.39779"

farmio commented 3 weeks ago

Hmm... we even have a unit test for this exact device and datapoint. https://github.com/XKNX/xknxproject/blob/da73461cd9749d99f52d49e185e783488851a00a/test/resources/stubs/module-definition-test.json#L428 Is your project parsed german, like the test? "language_code": "de-DE" ~ line 12 What language was it parsed with 3.6.0 ?

envy commented 3 weeks ago

v3.6.0:

"info": {
      "project_id": "P-09B7",
      "name": "redacted",
      "last_modified": "2023-11-21T17:16:52.7002782Z",
      "group_address_style": "ThreeLevel",
      "guid": "d6877496-662e-4d0b-8cda-0300ce45cdee",
      "created_by": "ETS5",
      "schema_version": "20", 
      "tool_version": "5.7.1428.39779",
      "xknxproject_version": "3.6.0",
      "language_code": "de-DE"
    }

HA 2024.08.2:

"info": {
      "project_id": "P-09B7",
      "name": "redacted",
      "last_modified": "2024-07-31T12:03:30.7747823Z",
      "group_address_style": "ThreeLevel",
      "guid": "d6877496-662e-4d0b-8cda-0300ce45cdee",
      "created_by": "ETS5",
      "schema_version": "20",
      "tool_version": "5.7.1428.39779",
      "xknxproject_version": "3.7.1",
      "language_code": "de-DE"
    }

The project was changed in the between those parses, but nothing was changed with the DALI gateway, just other devices.

farmio commented 3 weeks ago

Hm... I have only changed a channel name in the application in the test-project and now the whole project file seems to be written in a different style now. From the exact same ETS build version. This leads me to think it is not a xknxproject version thing, but the project data is indeed different. ETS is always full of surprises 🙃