Skip to content

Commit

Permalink
Parse device channels (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Oct 28, 2023
1 parent e19e547 commit 1456dde
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 32 deletions.
34 changes: 32 additions & 2 deletions test/resources/stubs/module-definition-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"function_text": "Messwert empfangen",
"description": "",
"device_address": "1.1.1",
"channel": null,
"dpts": [
{
"main": 9,
Expand All @@ -45,6 +46,7 @@
"function_text": "Temperaturwert empfangen",
"description": "",
"device_address": "1.1.1",
"channel": "MD-2_M-1_MI-1_CH-1",
"dpts": [
{
"main": 9,
Expand All @@ -71,6 +73,7 @@
"function_text": "Sollwert vorgeben",
"description": "",
"device_address": "1.1.1",
"channel": "MD-2_M-1_MI-1_CH-1",
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -98,6 +101,7 @@
"function_text": "Temperaturwert empfangen",
"description": "Beschreibung KO 41",
"device_address": "1.1.1",
"channel": "MD-2_M-2_MI-1_CH-1",
"dpts": [
{
"main": 9,
Expand All @@ -124,6 +128,7 @@
"function_text": "Sollwert vorgeben",
"description": "Beschreibung KO 42 (U-Flag)",
"device_address": "1.1.1",
"channel": "MD-2_M-2_MI-1_CH-1",
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -151,6 +156,7 @@
"function_text": "Sollwert vorgeben",
"description": "",
"device_address": "1.1.2",
"channel": "MD-2_M-1_MI-1_CH-1",
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -221,7 +227,21 @@
"1.1.1/MD-2_M-1_MI-1_O-2-2_R-3",
"1.1.1/MD-2_M-2_MI-1_O-2-1_R-1",
"1.1.1/MD-2_M-2_MI-1_O-2-2_R-3"
]
],
"channels": {
"MD-2_M-1_MI-1_CH-1": {
"identifier": "MD-2_M-1_MI-1_CH-1",
"name": "Kanal A: Wohnzimmer"
},
"MD-2_M-2_MI-1_CH-1": {
"identifier": "MD-2_M-2_MI-1_CH-1",
"name": "Kanal B: Küche"
},
"CH-9": {
"identifier": "CH-9",
"name": "Szenen"
}
}
},
"1.1.2": {
"name": "AKH-0800.03 Heizungsaktor 8-fach, 4TE, 24/230VAC",
Expand All @@ -232,7 +252,17 @@
"project_uid": 13,
"communication_object_ids": [
"1.1.2/MD-2_M-1_MI-1_O-2-2_R-3"
]
],
"channels": {
"MD-2_M-1_MI-1_CH-1": {
"identifier": "MD-2_M-1_MI-1_CH-1",
"name": "Kanal A: Bad"
},
"CH-9": {
"identifier": "CH-9",
"name": "Szenen"
}
}
}
},
"group_addresses": {
Expand Down
11 changes: 9 additions & 2 deletions test/resources/stubs/test_project-ets4.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"function_text": "Switch On/Off",
"description": "",
"device_address": "0.0.1",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -45,6 +46,7 @@
"function_text": "State",
"description": "",
"device_address": "0.0.1",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -71,6 +73,7 @@
"function_text": "State",
"description": "",
"device_address": "0.0.1",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -97,6 +100,7 @@
"function_text": "Behang Auf-Ab fahren",
"description": "",
"device_address": "0.0.2",
"channel": null,
"dpts": [
{
"main": 1,
Expand Down Expand Up @@ -124,6 +128,7 @@
"function_text": "Lamellenverst./Stopp Auf-Ab",
"description": "",
"device_address": "0.0.2",
"channel": null,
"dpts": [
{
"main": 1,
Expand Down Expand Up @@ -173,7 +178,8 @@
"0.0.1/M-0083_A-0013-11-A9D6_O-0_R-10000",
"0.0.1/M-0083_A-0013-11-A9D6_O-5_R-10005",
"0.0.1/M-0083_A-0013-11-A9D6_O-13_R-4"
]
],
"channels": {}
},
"0.0.2": {
"name": "JRA/S4.230.5.1 Jal./Rol.Akt.Fahrzt.man.4f,230V,REG",
Expand All @@ -185,7 +191,8 @@
"communication_object_ids": [
"0.0.2/M-0002_A-A061-14-BE27_O-10_R-485",
"0.0.2/M-0002_A-A061-14-BE27_O-71_R-1506"
]
],
"channels": {}
}
},
"group_addresses": {
Expand Down
76 changes: 72 additions & 4 deletions test/resources/stubs/xknx_test_project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"function_text": "Move blinds/shutter up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -45,6 +46,7 @@
"function_text": "Slat adjustm./stop up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -71,6 +73,7 @@
"function_text": "Move blinds/shutter up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -97,6 +100,7 @@
"function_text": "Slat adjustm./stop up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -123,6 +127,7 @@
"function_text": "Move blinds/shutter up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -149,6 +154,7 @@
"function_text": "Slat adjustm./stop up-down",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -175,6 +181,7 @@
"function_text": "Wind alarm no. 1",
"description": "",
"device_address": "1.1.5",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -201,6 +208,7 @@
"function_text": "Output value",
"description": "2-byte generic",
"device_address": "1.1.6",
"channel": null,
"dpts": [],
"object_size": "2 Bytes",
"flags": {
Expand All @@ -222,6 +230,7 @@
"function_text": "Measured value outside range",
"description": "1-bit undefined DPT",
"device_address": "1.1.6",
"channel": null,
"dpts": [
{
"main": 1,
Expand All @@ -248,6 +257,7 @@
"function_text": "Output value",
"description": "2-byte DPT 9 any",
"device_address": "1.1.6",
"channel": null,
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -368,6 +378,7 @@
"function_text": "Output value",
"description": "2-byte DPT 9 generic",
"device_address": "1.1.6",
"channel": null,
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -395,6 +406,7 @@
"function_text": "Command value - Heating",
"description": "",
"device_address": "1.1.7",
"channel": "MD-2_M-20_MI-1_CH-81",
"dpts": [
{
"main": 5,
Expand All @@ -421,6 +433,7 @@
"function_text": "Setpoint temperature - Active operating mode",
"description": "",
"device_address": "1.1.7",
"channel": "MD-2_M-20_MI-1_CH-81",
"dpts": [
{
"main": 9,
Expand All @@ -447,6 +460,7 @@
"function_text": "Setpoint temperature - Active operating mode - Status",
"description": "",
"device_address": "1.1.7",
"channel": "MD-2_M-20_MI-1_CH-81",
"dpts": [
{
"main": 9,
Expand All @@ -473,6 +487,7 @@
"function_text": "Room temperature - Measured value 1",
"description": "",
"device_address": "1.1.7",
"channel": "MD-2_M-20_MI-1_CH-81",
"dpts": [
{
"main": 9,
Expand Down Expand Up @@ -538,7 +553,8 @@
"manufacturer_name": "MDT technologies",
"individual_address": "1.1.0",
"project_uid": 25,
"communication_object_ids": []
"communication_object_ids": [],
"channels": {}
},
"1.1.5": {
"name": "JRA/S4.230.2.1 Blind/RollerShutterAct,M,4f,230V",
Expand All @@ -555,7 +571,8 @@
"1.1.5/O-100_R-1577",
"1.1.5/O-101_R-1578",
"1.1.5/O-4_R-1417"
]
],
"channels": {}
},
"1.1.6": {
"name": "AE/S4.2 Analogue Input,4-fold,MDRC",
Expand All @@ -569,7 +586,8 @@
"1.1.6/O-20_R-8108",
"1.1.6/O-9_R-9073",
"1.1.6/O-18_R-7994"
]
],
"channels": {}
},
"1.1.7": {
"name": "Heating actuator 6-gang with controller",
Expand All @@ -583,7 +601,57 @@
"1.1.7/MD-2_M-20_MI-1_O-5-0_R-17",
"1.1.7/MD-2_M-20_MI-1_O-5-10_R-18",
"1.1.7/MD-2_M-20_MI-1_O-7-1_R-45"
]
],
"channels": {
"MD-1_M-13_MI-1_CH-80": {
"identifier": "MD-1_M-13_MI-1_CH-80",
"name": "Ventilausgang 1 (...)"
},
"MD-1_M-8_MI-1_CH-80": {
"identifier": "MD-1_M-8_MI-1_CH-80",
"name": "Ventilausgang 2 (...)"
},
"MD-1_M-1_MI-1_CH-80": {
"identifier": "MD-1_M-1_MI-1_CH-80",
"name": "Ventilausgang 3 (...)"
},
"MD-1_M-2_MI-1_CH-80": {
"identifier": "MD-1_M-2_MI-1_CH-80",
"name": "Ventilausgang 4 (...)"
},
"MD-1_M-6_MI-1_CH-80": {
"identifier": "MD-1_M-6_MI-1_CH-80",
"name": "Ventilausgang 5 (...)"
},
"MD-1_M-3_MI-1_CH-80": {
"identifier": "MD-1_M-3_MI-1_CH-80",
"name": "Ventilausgang 6 (...)"
},
"MD-2_M-20_MI-1_CH-81": {
"identifier": "MD-2_M-20_MI-1_CH-81",
"name": "Raumtemperaturregler 1 (...)"
},
"MD-2_M-4_MI-1_CH-81": {
"identifier": "MD-2_M-4_MI-1_CH-81",
"name": "Raumtemperaturregler 2 (...)"
},
"MD-2_M-9_MI-1_CH-81": {
"identifier": "MD-2_M-9_MI-1_CH-81",
"name": "Raumtemperaturregler 3 (...)"
},
"MD-2_M-10_MI-1_CH-81": {
"identifier": "MD-2_M-10_MI-1_CH-81",
"name": "Raumtemperaturregler 4 (...)"
},
"MD-2_M-11_MI-1_CH-81": {
"identifier": "MD-2_M-11_MI-1_CH-81",
"name": "Raumtemperaturregler 5 (...)"
},
"MD-2_M-12_MI-1_CH-81": {
"identifier": "MD-2_M-12_MI-1_CH-81",
"name": "Raumtemperaturregler 6 (...)"
}
}
}
},
"group_addresses": {
Expand Down
Loading

0 comments on commit 1456dde

Please sign in to comment.