Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions script/refresh_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@
import json
from pathlib import Path

from test.test_knxproj import PROJECT_FIXTURES
from xknxproject import XKNXProj

# run from project directory
# python3 -m script.refresh_stubs

file_names = [
("module-definition-test", "test", "de-DE"),
("xknx_test_project", "test", None),
("test_project-ets4", "test", "de-DE"),
("testprojekt-ets6-functions", None, "de-DE"),
("ets6_free", None, "de-DE"),
("ets6_two_level", None, "de-DE"),
]

for file_name, password, language in file_names:
for file_name, password, language in PROJECT_FIXTURES:
print(f"Parsing {file_name}.knxproj")
knxproj = XKNXProj(
path=f"test/resources/{file_name}.knxproj",
Expand Down
Binary file added test/resources/smart_linking.knxproj
Binary file not shown.
96 changes: 64 additions & 32 deletions test/resources/stubs/module-definition-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
},
"group_address_links": [
"0/0/3"
]
],
"dpas": null
},
"1.1.1/MD-2_M-1_MI-1_O-2-1_R-1": {
"name": "IstWert",
Expand Down Expand Up @@ -71,7 +72,8 @@
},
"group_address_links": [
"0/0/1"
]
],
"dpas": null
},
"1.1.1/MD-2_M-1_MI-1_O-2-2_R-3": {
"name": "SollWert",
Expand Down Expand Up @@ -104,7 +106,8 @@
"group_address_links": [
"0/0/2",
"0/7/2"
]
],
"dpas": null
},
"1.1.1/MD-2_M-2_MI-1_O-2-1_R-1": {
"name": "IstWert",
Expand Down Expand Up @@ -136,7 +139,8 @@
},
"group_address_links": [
"0/1/1"
]
],
"dpas": null
},
"1.1.1/MD-2_M-2_MI-1_O-2-2_R-3": {
"name": "SollWert",
Expand Down Expand Up @@ -169,7 +173,8 @@
"group_address_links": [
"0/1/2",
"0/7/2"
]
],
"dpas": null
},
"1.1.2/MD-2_M-1_MI-1_O-2-2_R-3": {
"name": "SollWert",
Expand Down Expand Up @@ -202,7 +207,8 @@
"group_address_links": [
"0/2/2",
"0/7/2"
]
],
"dpas": null
},
"1.1.2/MD-2_M-1_MI-1_O-2-19_R-6": {
"name": "ModeKomfort",
Expand Down Expand Up @@ -234,7 +240,8 @@
},
"group_address_links": [
"0/6/7"
]
],
"dpas": null
},
"1.1.2/O-334_R-21": {
"name": "FuehrungsWert",
Expand Down Expand Up @@ -263,7 +270,8 @@
},
"group_address_links": [
"0/6/10"
]
],
"dpas": null
},
"1.1.2/MD-2_M-5_MI-1_O-2-8_R-18": {
"name": "SollwertAkt",
Expand Down Expand Up @@ -295,7 +303,8 @@
},
"group_address_links": [
"0/6/8"
]
],
"dpas": null
},
"1.1.2/MD-2_M-6_MI-1_O-2-20_R-7": {
"name": "Mode Nacht",
Expand Down Expand Up @@ -327,7 +336,8 @@
},
"group_address_links": [
"0/6/9"
]
],
"dpas": null
},
"1.1.3/O-24_R-966": {
"name": "Status On/Off (ECG1-ECG16)",
Expand Down Expand Up @@ -356,7 +366,8 @@
},
"group_address_links": [
"0/6/0"
]
],
"dpas": null
},
"1.1.3/MD-2_M-3_MI-2_O-2-1_R-11": {
"name": "Group 1, Dimming",
Expand Down Expand Up @@ -388,7 +399,8 @@
},
"group_address_links": [
"0/6/1"
]
],
"dpas": null
},
"1.1.3/MD-2_M-3_MI-3_O-2-0_R-10": {
"name": "Group 1, Switching",
Expand Down Expand Up @@ -420,7 +432,8 @@
},
"group_address_links": [
"0/6/2"
]
],
"dpas": null
},
"1.1.3/MD-1_M-1_MI-1_O-2-0_R-7": {
"name": "ECG 1, Switching",
Expand Down Expand Up @@ -452,7 +465,8 @@
},
"group_address_links": [
"0/6/3"
]
],
"dpas": null
},
"1.1.3/MD-1_M-1_MI-4_O-2-1_R-8": {
"name": "ECG 1, Dimming",
Expand Down Expand Up @@ -484,7 +498,8 @@
},
"group_address_links": [
"0/6/4"
]
],
"dpas": null
},
"1.1.3/MD-3_M-2_MI-2_O-2-4_R-5": {
"name": "MD1, Error",
Expand Down Expand Up @@ -516,7 +531,8 @@
},
"group_address_links": [
"0/6/5"
]
],
"dpas": null
},
"1.1.3/MD-3_M-2_MI-8_O-2-5_R-6": {
"name": "MD1, BrightnessSwitch",
Expand Down Expand Up @@ -548,7 +564,8 @@
},
"group_address_links": [
"0/6/6"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-1_SM-1_M-1_MI-1-1-1_SM-1_O-3-0_R-1": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].energy",
Expand Down Expand Up @@ -580,7 +597,8 @@
},
"group_address_links": [
"0/6/12"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-1_SM-1_M-1_MI-1-1-1_SM-1_O-3-1_R-2": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].power",
Expand Down Expand Up @@ -612,7 +630,8 @@
},
"group_address_links": [
"0/6/13"
]
],
"dpas": null
},
"1.1.4/O-256_R-36": {
"name": "oEnMon.consumedEnergy",
Expand Down Expand Up @@ -641,7 +660,8 @@
},
"group_address_links": [
"0/6/11"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-1_SM-1_O-3-0_R-1": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].energy",
Expand Down Expand Up @@ -673,7 +693,8 @@
},
"group_address_links": [
"0/6/15"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-1_SM-1_M-1_MI-1-1-2_SM-1_O-3-0_R-1": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].energy",
Expand Down Expand Up @@ -705,7 +726,8 @@
},
"group_address_links": [
"0/6/14"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-2_SM-1_O-3-0_R-1": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].energy",
Expand Down Expand Up @@ -737,7 +759,8 @@
},
"group_address_links": [
"0/6/16"
]
],
"dpas": null
},
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-2_SM-1_O-3-1_R-2": {
"name": "oEnMon.devicePage[{{EnMonPageNum}}][{{EnMonDevNameNum}}].power",
Expand Down Expand Up @@ -769,7 +792,8 @@
},
"group_address_links": [
"0/6/17"
]
],
"dpas": null
}
},
"topology": {
Expand Down Expand Up @@ -845,7 +869,8 @@
"1.1.1/MD-2_M-1_MI-1_O-2-22_R-21",
"1.1.1/MD-2_M-1_MI-1_O-2-15_R-68",
"1.1.1/MD-2_M-1_MI-1_O-2-12_R-55"
]
],
"functional_blocks": null
},
"MD-2_M-2_MI-1_CH-1": {
"identifier": "MD-2_M-2_MI-1_CH-1",
Expand All @@ -865,14 +890,16 @@
"1.1.1/MD-2_M-2_MI-1_O-2-22_R-21",
"1.1.1/MD-2_M-2_MI-1_O-2-15_R-68",
"1.1.1/MD-2_M-2_MI-1_O-2-12_R-55"
]
],
"functional_blocks": null
},
"CH-9": {
"identifier": "CH-9",
"name": "Szenen",
"communication_object_ids": [
"1.1.1/O-332_R-19"
]
],
"functional_blocks": null
}
}
},
Expand Down Expand Up @@ -911,7 +938,8 @@
"1.1.2/MD-2_M-1_MI-1_O-2-22_R-21",
"1.1.2/MD-2_M-1_MI-1_O-2-15_R-68",
"1.1.2/MD-2_M-1_MI-1_O-2-12_R-55"
]
],
"functional_blocks": null
},
"MD-2_M-5_MI-1_CH-1": {
"identifier": "MD-2_M-5_MI-1_CH-1",
Expand All @@ -931,7 +959,8 @@
"1.1.2/MD-2_M-5_MI-1_O-2-22_R-21",
"1.1.2/MD-2_M-5_MI-1_O-2-15_R-68",
"1.1.2/MD-2_M-5_MI-1_O-2-12_R-55"
]
],
"functional_blocks": null
},
"MD-2_M-6_MI-1_CH-1": {
"identifier": "MD-2_M-6_MI-1_CH-1",
Expand All @@ -951,14 +980,16 @@
"1.1.2/MD-2_M-6_MI-1_O-2-22_R-21",
"1.1.2/MD-2_M-6_MI-1_O-2-15_R-68",
"1.1.2/MD-2_M-6_MI-1_O-2-12_R-55"
]
],
"functional_blocks": null
},
"CH-9": {
"identifier": "CH-9",
"name": "Szenen",
"communication_object_ids": [
"1.1.2/O-332_R-19"
]
],
"functional_blocks": null
}
}
},
Expand Down Expand Up @@ -1028,7 +1059,8 @@
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-2_SM-1_O-3-0_R-1",
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-1_SM-1_O-3-1_R-2",
"1.1.4/MD-4_M-15_MI-2_SM-1_M-1_MI-2-1-1_SM-1_O-3-0_R-1"
]
],
"functional_blocks": null
}
}
}
Expand Down
Loading
Loading