Skip to content

Commit 5b06bc2

Browse files
authored
Remove support for a nonexistent second LED (#561)
* ui: Update node-red flow for single led mode * doc: Update mqtt reference for single led mode * update backend
1 parent 9133a97 commit 5b06bc2

File tree

3 files changed

+21
-107
lines changed

3 files changed

+21
-107
lines changed

documentation/docs/reference/software/interfaces/mqtt.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ The `on` command turns on the sample illumination LED. For example:
187187
```json
188188
{
189189
"action": "on",
190-
"led": "1"
191190
}
192191
```
193192

@@ -196,16 +195,14 @@ The `on` command has the following parameters:
196195
| Field | Description | Type | Accepted Values |
197196
| -------- | -------------------------------------------------- | ------- | --------------- |
198197
| `action` | Specifies the `on` command. | string | `on` |
199-
| `led` | Specifies the LED to turn on.<br/>Defaults to `1`. | integer | `1` (optional) |
200198

201199
#### `on` command responses
202200

203201
The Python backend can send status updates on the `status/light` topic in response to the `on` command. The `status` field of such status updates can have any of the following values:
204202

205203
| Status/Error | Cause |
206204
| ----------------------- | ----------------------------------------------------------------- |
207-
| `Led 1: On` | The LED turned on successfully. |
208-
| `Error with LED number` | An invalid value was provided for the `led` field of the command. |
205+
| `On` | The LED turned on successfully. |
209206

210207
### `off` command
211208

@@ -222,16 +219,14 @@ The `off` command has the following parameters:
222219
| Field | Description | Type | Accepted Values |
223220
| -------- | ------------------------------------------------- | ------- | --------------- |
224221
| `action` | Specifies the `off` command. | string | `off` |
225-
| `led` | Specifies the LED to turn on.<br/>Defaults to `1` | integer | `1` |
226222

227223
#### `off` command responses
228224

229225
The Python backend can send status updates on the `status/light` topic in response to the `off` command. The `status` field of such status updates can have any of the following values:
230226

231227
| Status/Error | Cause |
232228
| ----------------------- | ----------------------------------------------------------------- |
233-
| `Led 1: Off` | The LED turned off successfully. |
234-
| `Error with LED number` | An invalid value was provided for the `led` field of the command. |
229+
| `Off` | The LED turned off successfully. |
235230

236231
### Non-response status updates
237232

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6e1e468
1+
894a816

software/node-red-dashboard/flows/planktoscopehat.json

Lines changed: 18 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -4012,9 +4012,15 @@
40124012
"label": "Light ",
40134013
"stateField": "payload",
40144014
"enableField": "enable",
4015+
"passthroughField": "passthrough",
4016+
"inputMsgField": "inputmsg",
40154017
"rounded": true,
40164018
"useThemeColors": true,
40174019
"hideSelectedLabel": false,
4020+
"multilineLabel": false,
4021+
"passThrough": "never",
4022+
"inputMsg": "all",
4023+
"userInput": "enabled_show",
40184024
"options": [
40194025
{
40204026
"label": "Off",
@@ -4029,6 +4035,7 @@
40294035
"color": "#999999"
40304036
}
40314037
],
4038+
"topic": "",
40324039
"x": 310,
40334040
"y": 120,
40344041
"wires": [
@@ -4042,11 +4049,13 @@
40424049
"type": "function",
40434050
"z": "bccd1f23.87219",
40444051
"name": "Prepare message",
4045-
"func": "msg.topic = \"light\"\nmsg.payload = {\"action\":msg.payload}\n\nvar led_output = flow.get('led_output')\nif (led_output !== undefined && led_output !== \"\") {\n msg.payload[\"led\"] = led_output\n}\n\nreturn msg;",
4052+
"func": "msg.topic = \"light\"\nmsg.payload = {\"action\":msg.payload}\n\nreturn msg;",
40464053
"outputs": 1,
4054+
"timeout": "",
40474055
"noerr": 0,
40484056
"initialize": "",
40494057
"finalize": "",
4058+
"libs": [],
40504059
"x": 490,
40514060
"y": 120,
40524061
"wires": [
@@ -4063,108 +4072,16 @@
40634072
"topic": "",
40644073
"qos": "",
40654074
"retain": "",
4075+
"respTopic": "",
4076+
"contentType": "",
4077+
"userProps": "",
4078+
"correl": "",
4079+
"expiry": "",
40664080
"broker": "8dc3722c.06efa8",
40674081
"x": 650,
40684082
"y": 120,
40694083
"wires": []
40704084
},
4071-
{
4072-
"id": "4535ab65.009354",
4073-
"type": "ui_multistate_switch",
4074-
"z": "bccd1f23.87219",
4075-
"name": "led_output",
4076-
"group": "4248342d.e55fac",
4077-
"order": 2,
4078-
"width": 6,
4079-
"height": 1,
4080-
"label": "LED output",
4081-
"stateField": "payload",
4082-
"enableField": "enable",
4083-
"rounded": true,
4084-
"useThemeColors": true,
4085-
"hideSelectedLabel": false,
4086-
"options": [
4087-
{
4088-
"label": "1",
4089-
"value": "1",
4090-
"valueType": "num",
4091-
"color": "#009933"
4092-
},
4093-
{
4094-
"label": "2",
4095-
"value": "2",
4096-
"valueType": "num",
4097-
"color": "#999999"
4098-
}
4099-
],
4100-
"x": 310,
4101-
"y": 180,
4102-
"wires": [
4103-
[
4104-
"152f58e5.ca51df"
4105-
]
4106-
]
4107-
},
4108-
{
4109-
"id": "703d6ecd.62af88",
4110-
"type": "inject",
4111-
"z": "bccd1f23.87219",
4112-
"name": "Default: 1",
4113-
"props": [
4114-
{
4115-
"p": "payload"
4116-
}
4117-
],
4118-
"repeat": "",
4119-
"crontab": "",
4120-
"once": true,
4121-
"onceDelay": 0.1,
4122-
"topic": "",
4123-
"payload": "1",
4124-
"payloadType": "num",
4125-
"x": 120,
4126-
"y": 180,
4127-
"wires": [
4128-
[
4129-
"4535ab65.009354"
4130-
]
4131-
]
4132-
},
4133-
{
4134-
"id": "152f58e5.ca51df",
4135-
"type": "change",
4136-
"z": "bccd1f23.87219",
4137-
"name": "",
4138-
"rules": [
4139-
{
4140-
"t": "set",
4141-
"p": "led_output",
4142-
"pt": "flow",
4143-
"to": "payload",
4144-
"tot": "msg"
4145-
},
4146-
{
4147-
"t": "set",
4148-
"p": "payload",
4149-
"pt": "msg",
4150-
"to": "on",
4151-
"tot": "str"
4152-
}
4153-
],
4154-
"action": "",
4155-
"property": "",
4156-
"from": "",
4157-
"to": "",
4158-
"reg": false,
4159-
"x": 480,
4160-
"y": 180,
4161-
"wires": [
4162-
[
4163-
"f0775525.cf806",
4164-
"99ae4886.8d43c"
4165-
]
4166-
]
4167-
},
41684085
{
41694086
"id": "8ea9dc9a.c7d87",
41704087
"type": "function",
@@ -8401,6 +8318,8 @@
84018318
"qos": "0",
84028319
"datatype": "json",
84038320
"broker": "8dc3722c.06efa8",
8321+
"nl": false,
8322+
"rap": false,
84048323
"inputs": 0,
84058324
"x": 290,
84068325
"y": 340,
@@ -9287,4 +9206,4 @@
92879206
"y": 120,
92889207
"wires": []
92899208
}
9290-
]
9209+
]

0 commit comments

Comments
 (0)