@haydendonald/node-red-contrib-hass-stuff 1.1.5 → 1.1.7

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.
@@ -85,12 +85,12 @@
85
85
  </div>
86
86
  <div class="form-row">
87
87
  <label style="font-weight: bold;" for="node-config-input-relaxSettings">Relax Settings</label>
88
- <p>The scene to use for the relax scene (7am-8am and 7-8pm) [scene] [brightnessPercent]</p>
88
+ <p>The scene to use for the relax scene (7am-8am and 7-10pm) [scene] [brightnessPercent]</p>
89
89
  <input type="text" id="node-config-input-relaxSettings" />
90
90
  </div>
91
91
  <div class="form-row">
92
92
  <label style="font-weight: bold;" for="node-config-input-restSettings">Rest Settings</label>
93
- <p>The scene to use for the rest scene (6am - 7am) (8-11pm) [scene] [brightnessPercent]</p>
93
+ <p>The scene to use for the rest scene (6am - 7am) (10-11pm) [scene] [brightnessPercent]</p>
94
94
  <input type="text" id="node-config-input-restSettings" />
95
95
  </div>
96
96
  <div class="form-row">
@@ -87,6 +87,11 @@ module.exports = function LightControlConfigNode(RED) {
87
87
  sceneName: config.relaxSettings.split(" ")[0],
88
88
  brightnessPct: parseInt(config.relaxSettings.split(" ")[1])
89
89
  },
90
+ rest: {
91
+ friendlyName: "Rest",
92
+ sceneName: config.restSettings.split(" ")[0],
93
+ brightnessPct: parseInt(config.restSettings.split(" ")[1])
94
+ },
90
95
  nightLight: {
91
96
  friendlyName: "Night Light",
92
97
  sceneName: config.nightLightSettings.split(" ")[0],
@@ -129,7 +134,7 @@ module.exports = function LightControlConfigNode(RED) {
129
134
  friendlyName: `${self.name} - ${sceneValue.friendlyName}`,
130
135
  id: (0, utility_1.getEntityId)("scene", `${self.name}_${sceneKey}`),
131
136
  creationCallback: (response) => { },
132
- activatedCallback: (serviceData) => {
137
+ activatedCallback: (state, serviceData) => {
133
138
  //Set our scene
134
139
  connectionsConfigNode.sendHASSAction("select.select_option", { entity_id: [(0, utility_1.getEntityId)("select", `${self.name}_current_scene`)] }, {
135
140
  option: sceneValue.friendlyName
@@ -143,7 +148,7 @@ module.exports = function LightControlConfigNode(RED) {
143
148
  friendlyName: `${self.name} - Adaptive`,
144
149
  id: (0, utility_1.getEntityId)("scene", `${self.name}_adaptive`),
145
150
  creationCallback: (response) => { },
146
- activatedCallback: (serviceData) => {
151
+ activatedCallback: (state, serviceData) => {
147
152
  //Set our scene to adaptive
148
153
  connectionsConfigNode.sendHASSAction("select.select_option", { entity_id: [(0, utility_1.getEntityId)("select", `${self.name}_current_scene`)] }, {
149
154
  option: "Adaptive"
@@ -156,7 +161,7 @@ module.exports = function LightControlConfigNode(RED) {
156
161
  friendlyName: `${self.name} - Turn On`,
157
162
  id: (0, utility_1.getEntityId)("scene", `${self.name}_turn_on`),
158
163
  creationCallback: (response) => { },
159
- activatedCallback: (serviceData) => {
164
+ activatedCallback: (state, serviceData) => {
160
165
  runLights(serviceData.transition || 1, true);
161
166
  }
162
167
  });
@@ -165,7 +170,7 @@ module.exports = function LightControlConfigNode(RED) {
165
170
  friendlyName: `${self.name} - Turn Off`,
166
171
  id: (0, utility_1.getEntityId)("scene", `${self.name}_turn_off`),
167
172
  creationCallback: (response) => { },
168
- activatedCallback: (serviceData) => {
173
+ activatedCallback: (state, serviceData) => {
169
174
  connectionsConfigNode.sendHASSAction("light.turn_off", { entity_id: [config.groupEntityId] }, {
170
175
  transition: serviceData.transition || 1
171
176
  });
@@ -176,7 +181,7 @@ module.exports = function LightControlConfigNode(RED) {
176
181
  friendlyName: `${self.name} - Toggle`,
177
182
  id: (0, utility_1.getEntityId)("scene", `${self.name}_toggle`),
178
183
  creationCallback: (response) => { },
179
- activatedCallback: (serviceData) => {
184
+ activatedCallback: (state, serviceData) => {
180
185
  if (currentState.state == "off") {
181
186
  runLights(serviceData.transition || 1, true);
182
187
  }
@@ -313,10 +318,10 @@ module.exports = function LightControlConfigNode(RED) {
313
318
  else if (currentHour >= 15 && currentHour < 19) {
314
319
  scene = scenes["read"];
315
320
  }
316
- else if (currentHour >= 19 && currentHour < 20) {
321
+ else if (currentHour >= 19 && currentHour < 22) {
317
322
  scene = scenes["relax"];
318
323
  }
319
- else if (currentHour >= 20 && currentHour < 23) {
324
+ else if (currentHour >= 22 && currentHour < 23) {
320
325
  scene = scenes["rest"];
321
326
  }
322
327
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haydendonald/node-red-contrib-hass-stuff",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "A collection of stuff I use on my Node Red + Home Assistant server. This could be of use for others, i don't know..",
5
5
  "devDependencies": {
6
6
  "@types/node": "^18.14.0",