Skip to content

Commit

Permalink
WB-MAO4-20mA fixes backport(#816)
Browse files Browse the repository at this point in the history
* Allow floating-point numbers in "max" channel property (#813)
* WB-MAO4-20 template improvements (#815)

---------

Co-authored-by: Nikolay Korotkiy <[email protected]>
  • Loading branch information
pgasheev and sikmir authored Sep 25, 2024
1 parent 00d5113 commit 6f5ef4b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
wb-mqtt-serial (2.138.1-wb105) stable; urgency=medium

* JSON schema: allow floating-point numbers in "max" channel property
* WB-MAO4-20 template: allow 20.48 mA max current

-- Pavel Gasheev <[email protected]> Wed, 25 Sep 2024 10:51:55 +0300

wb-mqtt-serial (2.138.1-wb104) stable; urgency=medium

* Add WB-MAO4-20mA support
Expand Down
14 changes: 7 additions & 7 deletions templates/config-wb-mao4-20ma.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@
"enum_titles": [
"Turn Off",
"Turn On",
"Increase Level",
"Decrease Level"
"Decrease Level",
"Increase Level"
],
"default": 0,
"group": "input_{{ch_number + 1}}_{{press_type | replace(' ', '_') }}_press_action",
Expand Down Expand Up @@ -595,14 +595,14 @@
"address": {{index}},
"type": "value",
"units": "mA",
"max": 20,
"max": 20.48,
"scale": 0.001,
"enabled": false,
"group": "gg_output_{{index + 1}}_channels"
},
{
"id": "channel_{{index + 1}}_open_circuit_fail",
"name": "Channel {{index + 1}} Open Circuit Fail",
"id": "channel_{{index + 1}}_fault",
"name": "Channel {{index + 1}} Fault",
"reg_type": "discrete",
"address": {{16 + index}},
"type": "switch",
Expand Down Expand Up @@ -702,7 +702,7 @@
"input_debounce_time_description": "Must be 5-10 times less than second press waiting time. Adds a delay to the response to presses",

"output_description": "Output can be controlled by:<br>1) setting level in percentage between working range limits<br>2) setting output current in mA (level of the channel will not change)",
"g_safety_description": "Safety mode is activated when there is no modbus polling for the specified time. Supported since firmware version 2.5.0",
"g_safety_description": "Safety mode is activated when there is no modbus polling for the specified time",
"poll_timeout_description": "Time in seconds without modbus polling before activation safety mode. Actions in safety mode are configured using appropriate parameters",
"inputs_control_in_safety_mode_description": "Sets change of control from the inputs when module switches to safety mode",
"g_power_up_behaviour_description": "Actions that will be performed when power is applied to the module"
Expand Down Expand Up @@ -739,7 +739,7 @@
"Channel {{ch_number}}": "Канал {{ch_number}}",
"Channel {{ch_number}} Level": "Уровень канала {{ch_number}}",
"Channel {{ch_number}} Current": "Ток канала {{ch_number}}",
"Channel {{ch_number}} Open Circuit Fail": "Обрыв цепи канала {{ch_number}}",
"Channel {{ch_number}} Fault": "Ошибка канала {{ch_number}}",
"Channel {{ch_number}} Duty Cycle Raw": "Прямое задание скважности ШИМ на выходе {{ch_number}}",
{% endfor -%}

Expand Down
8 changes: 4 additions & 4 deletions test/TDeviceTemplatesTest.Validate.dat
Original file line number Diff line number Diff line change
Expand Up @@ -23485,23 +23485,23 @@ wb_mao4_20ma
Channel 1 => channel_1
Channel 1 Current => channel_1_current
Channel 1 Duty Cycle Raw => channel_1_duty_cycle_raw
Channel 1 Fault => channel_1_fault
Channel 1 Level => channel_1_level
Channel 1 Open Circuit Fail => channel_1_open_circuit_fail
Channel 2 => channel_2
Channel 2 Current => channel_2_current
Channel 2 Duty Cycle Raw => channel_2_duty_cycle_raw
Channel 2 Fault => channel_2_fault
Channel 2 Level => channel_2_level
Channel 2 Open Circuit Fail => channel_2_open_circuit_fail
Channel 3 => channel_3
Channel 3 Current => channel_3_current
Channel 3 Duty Cycle Raw => channel_3_duty_cycle_raw
Channel 3 Fault => channel_3_fault
Channel 3 Level => channel_3_level
Channel 3 Open Circuit Fail => channel_3_open_circuit_fail
Channel 4 => channel_4
Channel 4 Current => channel_4_current
Channel 4 Duty Cycle Raw => channel_4_duty_cycle_raw
Channel 4 Fault => channel_4_fault
Channel 4 Level => channel_4_level
Channel 4 Open Circuit Fail => channel_4_open_circuit_fail
FW Version => fw_version
Input 1 => input_1
Input 1 Counter => input_1_counter
Expand Down
18 changes: 17 additions & 1 deletion wb-mqtt-serial-confed-common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
},
"max": {
"title": "Maximum value",
"$ref": "#/definitions/serial_int",
"$ref": "#/definitions/serial_num",
"propertyOrder": 10,
"options": {
"keep_oneof_values": false
Expand Down Expand Up @@ -994,6 +994,22 @@
}
]
},
"serial_num": {
"oneOf": [
{
"title": "decimal or hex",
"type": "string",
"pattern": "^(0x[A-Fa-f\\d]+|\\d+)$",
"options": {
"patternmessage": "Should be decimal or hex"
}
},
{
"title": "decimal",
"type": "number"
}
]
},

"no_setup": {
"properties": {
Expand Down

0 comments on commit 6f5ef4b

Please sign in to comment.