node-red-contrib-esphome 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -21,6 +21,8 @@ Node-RED nodes to ESPhome devices
21
21
 
22
22
  ## Changelog
23
23
 
24
+ #### 0.2.3
25
+ - support Text
24
26
  #### 0.2.1
25
27
  - support Status in node
26
28
  #### 0.2.0
@@ -41,7 +43,29 @@ $ npm i node-red-contrib-esphome
41
43
 
42
44
  ## Inputs
43
45
 
46
+ Inputs are sent to the node as JSON payloads. The list below provides a list of keys and values (and their expected value type) that may be sent to the "esphome out" nodes. It is helpful to watch the "esphome in" messages to learn which type and range of commands are expected by your device.
47
+
48
+ Some example message payloads are:
49
+
50
+ ```js
51
+ // to set a light on:
52
+ msg.payload = {'state': true}
53
+
54
+ // set a door lock to unlock:
55
+ msg.payload = {'command':0}
56
+
57
+ // to toggle a light to 42% brightness:
58
+ msg.payload = {'brightness': 42}
59
+
60
+ // to press a button:
61
+ msg.payload = true
62
+ ```
63
+
64
+
44
65
  #### Button
66
+
67
+ Button inputs may be triggered with any payload in the input message. Simply send a timestamp, `true`, or other payload to the button node. Button type nodes provide no messages into Node-RED.
68
+
45
69
  #### Climate
46
70
  - `mode` - optional. 0 - OFF, 1 - AUTO, 2 - COOL, 3 - HEAT, 4 - FAN_ONLY, 5 - DRY. See `supportedModesList` attr in config
47
71
  - `targetTemperature`- optional. float
@@ -96,6 +120,8 @@ $ npm i node-red-contrib-esphome
96
120
  - `volume` - optional. integer. See `supportsVolume` attr in config
97
121
  #### Switch
98
122
  - `state` - REQUIRED. boolean
123
+ #### Text
124
+ - `state` - REQUIRED. string. See `minLength`, `maxLength` attrs in config
99
125
 
100
126
  ## Pictures
101
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-esphome",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Node-RED nodes to ESPhome devices",
5
5
  "homepage": "https://github.com/twocolors/node-red-contrib-esphome",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@2colors/esphome-native-api": "^1.2.6"
32
+ "@2colors/esphome-native-api": "1.2.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^20.1.0",