Skip to content

Commit

Permalink
chore: add ESLint rule to enforce consistency in device config files …
Browse files Browse the repository at this point in the history
…and prevent some common errors (#6345)
  • Loading branch information
AlCalzone authored Oct 11, 2023
1 parent f54a9ac commit 8fcdc40
Show file tree
Hide file tree
Showing 957 changed files with 9,239 additions and 12,140 deletions.
6 changes: 1 addition & 5 deletions packages/config/config/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ module.exports = {
plugins: [
"@zwave-js",
],
rules: {
"@zwave-js/consistent-device-config-property-order": "error",
"@zwave-js/no-unnecessary-min-max-value": "error",
"@zwave-js/auto-unsigned": "error",
}
extends: "plugin:@zwave-js/config-files"
};
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0000/ps9ep.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Sigma Designs (Former Zensys)",
"manufacturerId": "0x0000",
"label": "PS9EP",
"description": "Z-wave 9 channel_module",
"description": "Z-Wave 9 Channel_module",
"devices": [
{
"productType": "0x0003",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0000/sm-pz701u.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Sigma Designs (Former Zensys)",
"manufacturerId": "0x0000",
"label": "SM-PZ701U",
"description": "Z-Wave power plug",
"description": "Z-Wave Power Plug",
"devices": [
{
"productType": "0x0003",
Expand Down
12 changes: 6 additions & 6 deletions packages/config/config/devices/0x0000/yrl220.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
{
"#": "2",
"label": "Auto Re-lock",
"label": "Auto Re-Lock",
"description": "When enabled, the unit will automatically re-lock",
"valueSize": 1,
"defaultValue": 0,
Expand All @@ -65,10 +65,10 @@
},
{
"#": "3",
"label": "Re-lock Time",
"label": "Re-Lock Time",
"description": "Time after unlocking that the device will lock",
"valueSize": 1,
"unit": "Seconds",
"unit": "seconds",
"minValue": 5,
"maxValue": 255,
"defaultValue": 30,
Expand Down Expand Up @@ -110,7 +110,7 @@
"label": "Shutdown Time",
"description": "Number of times the device is locked out after the invalid retries are exceeded",
"valueSize": 1,
"unit": "Seconds",
"unit": "seconds",
"minValue": 1,
"maxValue": 255,
"defaultValue": 30,
Expand All @@ -129,11 +129,11 @@
"value": 0
},
{
"label": "Vacation Mode",
"label": "Vacation mode",
"value": 1
},
{
"label": "Privacy Mode",
"label": "Privacy mode",
"value": 2
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0001/zrm230.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "HomePro",
"manufacturerId": "0x0001",
"label": "ZRM230",
"description": "Wall Switch/Transmitter (2-gang)",
"description": "Wall Switch/Transmitter (2-Gang)",
"devices": [
{
"productType": "0x524d",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0002/014g0210.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
{
"#": "3",
"label": "PWM period",
"label": "PWM Period",
"description": "Pulse-width modulation period",
"valueSize": 1,
"defaultValue": 2,
Expand Down
65 changes: 19 additions & 46 deletions packages/config/config/devices/0x0002/dthermz5.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Danfoss",
"manufacturerId": "0x0002",
"label": "DTHERMZ5",
"description": "Z-Wave room sensor",
"description": "Z-Wave Room Sensor",
"devices": [
{
"productType": "0x0248",
Expand All @@ -17,16 +17,16 @@
"paramInformation": [
{
"#": "1",
"label": "Temperature Report threshold",
"label": "Temperature Report Threshold",
"valueSize": 2,
"minValue": 1,
"maxValue": 100,
"defaultValue": 5
},
{
"#": "2",
"label": "Set-point display resolution",
"description": "range from 0.1 to 10°C 1=0.1°C 100=10°C",
"label": "Set-Point Display Resolution",
"description": "range from 0.1 to 10 °C 1=0.1 °C 100=10 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 1,
Expand All @@ -35,8 +35,8 @@
},
{
"#": "3",
"label": "Min Set-point and override limit",
"description": "from min 0°C to max setpoint override limit 0=0°C 40=40°C",
"label": "Min Set-Point and Override Limit",
"description": "from min 0 °C to max setpoint override limit 0=0 °C 40=40 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 0,
Expand All @@ -45,8 +45,8 @@
},
{
"#": "4",
"label": "Max Set-point and override limit",
"description": "from min setpoint override limit to max 40°C 0=0°C 40=40°C",
"label": "Max Set-Point and Override Limit",
"description": "from min setpoint override limit to max 40 °C 0=0 °C 40=40 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 0,
Expand All @@ -55,7 +55,7 @@
},
{
"#": "5",
"label": "LED Flash period",
"label": "LED Flash Period",
"description": "0 to 65535 seconds",
"valueSize": 4,
"unit": "seconds",
Expand All @@ -65,46 +65,19 @@
},
{
"#": "6",
"label": "Set-point control function",
"description": "0=Disabled 1=Enabled",
"valueSize": 1,
"unit": "int",
"defaultValue": 1,
"allowManualEntry": false,
"options": [
{
"label": "disabled",
"value": 0
},
{
"label": "enabled",
"value": 1
}
]
"$import": "~/templates/master_template.json#base_enable_disable",
"label": "Set-Point Control Function",
"defaultValue": 1
},
{
"#": "7",
"label": "Temporarily override scheduler",
"description": "0=Disabled 1=Enabled",
"valueSize": 1,
"unit": "int",
"defaultValue": 1,
"allowManualEntry": false,
"options": [
{
"label": "disabled",
"value": 0
},
{
"label": "enabled",
"value": 1
}
]
"$import": "~/templates/master_template.json#base_enable_disable",
"label": "Temporarily Override Scheduler",
"defaultValue": 1
},
{
"#": "8",
"label": "Set-point type in Thermostat_Setpoint_Reports",
"description": "1=Heating 2=Cooling 10=Auto Changeover",
"label": "Set-Point Type in Thermostat_Setpoint_Reports",
"valueSize": 1,
"defaultValue": 1,
"allowManualEntry": false,
Expand All @@ -125,7 +98,7 @@
},
{
"#": "9",
"label": "LED on time",
"label": "LED On Time",
"description": "1=100ms 5=500ms",
"valueSize": 2,
"minValue": 1,
Expand All @@ -134,7 +107,7 @@
},
{
"#": "10",
"label": "Number of LED flashes (duration)",
"label": "Number of LED Flashes (Duration)",
"description": "0 to 255",
"valueSize": 1,
"minValue": 0,
Expand All @@ -144,7 +117,7 @@
},
{
"#": "11",
"label": "LED color",
"label": "LED Color",
"description": "1=Green 2=Red",
"valueSize": 1,
"defaultValue": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Danfoss",
"manufacturerId": "0x0002",
"label": "Keemple smart radiator",
"description": "Electronic radiator thermostat, intended for use with water based room radiators.",
"description": "Electronic Radiator Thermostat, Intended for Use with Water Based Room Radiators.",
"devices": [
{
"productType": "0x5fff",
Expand Down
61 changes: 18 additions & 43 deletions packages/config/config/devices/0x0002/mt_2649.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"paramInformation": [
{
"#": "1",
"label": "Temperature Report threshold",
"label": "Temperature Report Threshold",
"valueSize": 2,
"minValue": 1,
"maxValue": 100,
"defaultValue": 5
},
{
"#": "2",
"label": "Set-point display resolution",
"description": "range from 0.1 to 10°C 1=0.1°C 100=10°C",
"label": "Set-Point Display Resolution",
"description": "range from 0.1 to 10 °C 1=0.1 °C 100=10 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 1,
Expand All @@ -42,8 +42,8 @@
},
{
"#": "3",
"label": "Min Set-point and override limit",
"description": "from min 0°C to max setpoint override limit 0=0°C 40=40°C",
"label": "Min Set-Point and Override Limit",
"description": "from min 0 °C to max setpoint override limit 0=0 °C 40=40 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 0,
Expand All @@ -52,8 +52,8 @@
},
{
"#": "4",
"label": "Max Set-point and override limit",
"description": "from min setpoint override limit to max 40°C 0=0°C 40=40°C",
"label": "Max Set-Point and Override Limit",
"description": "from min setpoint override limit to max 40 °C 0=0 °C 40=40 °C",
"valueSize": 2,
"unit": "°C",
"minValue": 0,
Expand All @@ -62,7 +62,7 @@
},
{
"#": "5",
"label": "LED Flash period",
"label": "LED Flash Period",
"description": "0 to 65535 seconds",
"valueSize": 4,
"unit": "seconds",
Expand All @@ -72,44 +72,19 @@
},
{
"#": "6",
"label": "Set-point control function",
"description": "0=Disabled 1=Enabled",
"valueSize": 1,
"defaultValue": 1,
"allowManualEntry": false,
"options": [
{
"label": "disabled",
"value": 0
},
{
"label": "enabled",
"value": 1
}
]
"$import": "~/templates/master_template.json#base_enable_disable",
"label": "Set-Point Control Function",
"defaultValue": 1
},
{
"#": "7",
"label": "Temporarily override scheduler",
"description": "0=Disabled 1=Enabled",
"valueSize": 1,
"defaultValue": 1,
"allowManualEntry": false,
"options": [
{
"label": "disabled",
"value": 0
},
{
"label": "enabled",
"value": 1
}
]
"$import": "~/templates/master_template.json#base_enable_disable",
"label": "Temporarily Override Scheduler",
"defaultValue": 1
},
{
"#": "8",
"label": "Set-point type in Thermostat_Setpoint_Reports",
"description": "1=Heating 2=Cooling 10=Auto Changeover",
"label": "Set-Point Type in Thermostat_Setpoint_Reports",
"valueSize": 1,
"defaultValue": 1,
"allowManualEntry": false,
Expand All @@ -130,7 +105,7 @@
},
{
"#": "9",
"label": "LED on time",
"label": "LED On Time",
"description": "1=100ms 5=500ms",
"valueSize": 2,
"minValue": 1,
Expand All @@ -139,7 +114,7 @@
},
{
"#": "10",
"label": "Number of LED flashes (duration)",
"label": "Number of LED Flashes (Duration)",
"description": "0 to 255",
"valueSize": 1,
"minValue": 0,
Expand All @@ -149,7 +124,7 @@
},
{
"#": "11",
"label": "LED color",
"label": "LED Color",
"description": "1=Green 2=Red",
"valueSize": 1,
"defaultValue": 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0002/rxz.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Danfoss",
"manufacturerId": "0x0002",
"label": "RXZ",
"description": "RF Relay switching unit",
"description": "RF Relay Switching Unit",
"devices": [
{
"productType": "0x8004",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0005/ha05.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Intermatic",
"manufacturerId": "0x0005",
"label": "HA05",
"description": "Screw in lamp module",
"description": "Screw in Lamp Module",
"devices": [
{
"productType": "0x0005",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/config/devices/0x0005/ha18.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manufacturer": "Intermatic",
"manufacturerId": "0x0005",
"label": "HA18",
"description": "15-amp Wall Switch",
"description": "15-Amp Wall Switch",
"devices": [
{
"productType": "0x4841",
Expand Down
Loading

0 comments on commit 8fcdc40

Please sign in to comment.