Skip to content

Commit 5deb884

Browse files
committed
last three nodes are deprecated
1 parent a0ed12c commit 5deb884

File tree

3 files changed

+46
-40
lines changed

3 files changed

+46
-40
lines changed

netatmo-set-person-away.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@
7878
<ul>
7979
<li>Home ID: something like 577fff842baa3c18948b4571</li>
8080
<li>Person ID (optional): something like 766764b1-dcef-4321-b057-e0c8e2e329cf</li>
81-
<li>If a Person ID is specified, that person will be set as "Away". If no person_id is specified, the Home will be set as "Empty".</li>
81+
<li>If a Person ID is specified, that person will be set as "Away". If no Person ID is specified, the Home will be set as "Empty".</li>
8282
</ul>
83-
<p>Home ID </p>
8483
<p>See <a href="https://dev.netatmo.com/apidocumentation/security#setpersonsaway" target=_blank>https://dev.netatmo.com/apidocumentation/security#setpersonsaway</a> for details on format</p>
8584
</script>

netatmoNodes.html

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@
202202

203203
</script>
204204

205-
<!-- ************************************************************* -->
205+
<!-- *************************************************************
206+
* Api is marked as deprecated by netatmo
207+
************************************************************* -->
206208

207209
<script type="text/javascript">
208210
console.log("registering netatmo get next events");
@@ -225,26 +227,27 @@
225227
});
226228
</script>
227229

228-
<script type="text/x-red" data-template-name="get next events">
230+
<script type="text/html" data-template-name="get next events">
229231
<div class="form-row">
230232
<label for="node-input-creds"><i class="fa fa-server"></i> Creds</label>
231233
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
232234
</div>
233235
<div class="form-row">
234236
<label for="node-input-home_id"><i class="icon-tag"></i> Home ID:</label>
235-
<input type="text" id="node-input-home_id" placeholder="577fff..."">
237+
<input type="text" id="node-input-home_id" placeholder="577fff...">
236238
</div>
237239
<div class="form-row">
238240
<label for="node-input-event_id"><i class="icon-tag"></i> Event ID:</label>
239241
<input type="text" id="node-input-event_id" placeholder="57816...">
240242
</div>
241243
<div class="form-row">
242-
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
244+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
243245
<input type="text" id="node-input-name" placeholder="Name">
244246
</div>
245247
</script>
246248

247-
<script type="text/x-red" data-help-name="get next events">
249+
<script type="text/html" data-help-name="get next events">
250+
<p><b>Api is marked as deprecated by netatmo.</b></p>
248251
<p>This node returns information about the netatmo welcome next events with these credentials.</p>
249252
<p>Parameters:</p>
250253
<ul>
@@ -255,7 +258,10 @@
255258
<b>msg.payload</b>. msg.payload is JSON.</p>
256259
<p>See <a href="https://dev.netatmo.com/dev/resources/technical/reference/welcome/getnextevents" target=_blank>https://dev.netatmo.com/dev/resources/technical/reference/welcome/getnextevents</a> for details on format</p>
257260
</script>
258-
<!-- ************************************************************* -->
261+
262+
<!-- *************************************************************
263+
* Api is marked as deprecated by netatmo
264+
************************************************************* -->
259265

260266
<script type="text/javascript">
261267
console.log("registering netatmo get camera picture");
@@ -277,7 +283,7 @@
277283
});
278284
</script>
279285

280-
<script type="text/x-red" data-template-name="get camera picture">
286+
<script type="text/html" data-template-name="get camera picture">
281287
<div class="form-row">
282288
<label for="node-input-creds"><i class="fa fa-server"></i> Creds</label>
283289
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
@@ -291,19 +297,21 @@
291297
<input type="text" id="node-input-key" placeholder="8627b4...">
292298
</div>
293299
<div class="form-row">
294-
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
300+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
295301
<input type="text" id="node-input-name" placeholder="Name">
296302
</div>
297303
</script>
298304

299-
<script type="text/x-red" data-help-name="get camera picture">
305+
<script type="text/html" data-help-name="get camera picture">
306+
<p><b>Api is marked as deprecated by netatmo.</b></p>
300307
<p>This node returns information about the netatmo welcome camera picture with these credentials.</p>
301308
<p>Outputs an object called <b>msg</b> containing <b>msg.topic</b> and
302309
<b>msg.payload</b>. msg.payload is JSON.</p>
303310
<p>See <a href="https://dev.netatmo.com/dev/resources/technical/reference/welcome/getcamerapicture" target=_blank>https://dev.netatmo.com/dev/resources/technical/reference/welcome/getcamerapicturer</a> for details on format</p>
304311
</script>
312+
305313
<!-- *************************************************************
306-
* Api is marked Deprecated by netatmo
314+
* Api is marked as deprecated by netatmo
307315
************************************************************* -->
308316

309317
<script type="text/javascript">
@@ -330,13 +338,13 @@
330338
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
331339
</div>
332340
<div class="form-row">
333-
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
341+
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
334342
<input type="text" id="node-input-name" placeholder="Name">
335343
</div>
336344
</script>
337345

338346
<script type="text/html" data-help-name="get home data">
339-
<p><b>Api is marked Deprecated by netatmo!</b></p>
347+
<p><b>Api is marked as deprecated by netatmo!</b></p>
340348
<p>This node returns information about the netatmo welcome home data with these credentials.</p>
341349
<p>Outputs an object called <b>msg</b> containing <b>msg.topic</b> and
342350
<b>msg.payload</b>. msg.payload is JSON.</p>
@@ -348,7 +356,6 @@
348356
<!-- ************************************************************* -->
349357

350358
<script type="text/javascript">
351-
// console.log("registering netatmo config node");
352359
RED.nodes.registerType('configNode',{
353360
category: 'config',
354361
credentials: {
@@ -364,8 +371,6 @@
364371
return this.name||"netatmo configNode";
365372
},
366373
oneditprepare: function() {
367-
// eslint-disable-next-line no-undef
368-
oneditprepareDeviceId(true);
369374
}
370375
});
371376
</script>

netatmoNodes.js

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ module.exports = function(RED) {
2525
this.event_id = config.event_id;
2626
var node = this;
2727
this.on('input', function(msg) {
28-
var netatmo = require('netatmo');
28+
const netatmo = require('netatmo');
2929

30-
var auth = {
31-
"client_id": this.creds.client_id,
32-
"client_secret": this.creds.client_secret,
33-
"username": this.creds.username,
34-
"password": this.creds.password
30+
const auth = {
31+
"client_id": this.creds.credentials.client_id,
32+
"client_secret": this.creds.credentials.client_secret,
33+
"username": this.creds.credentials.username,
34+
"password": this.creds.credentials.password
3535
};
36-
var api = new netatmo(auth);
36+
const api = new netatmo(auth);
3737
var options = {
3838
home_id: node.home_id,
3939
event_id: node.event_id
@@ -47,6 +47,7 @@ module.exports = function(RED) {
4747
node.warn(error);
4848
});
4949

50+
// Api is marked as deprecated by netatmo
5051
api.getNextEvents(options, function(err, events) {
5152
msg.payload = events;
5253
node.send(msg);
@@ -64,15 +65,15 @@ module.exports = function(RED) {
6465
this.key = config.key;
6566
var node = this;
6667
this.on('input', function(msg) {
67-
var netatmo = require('netatmo');
68+
const netatmo = require('netatmo');
6869

69-
var auth = {
70-
"client_id": this.creds.client_id,
71-
"client_secret": this.creds.client_secret,
72-
"username": this.creds.username,
73-
"password": this.creds.password
70+
const auth = {
71+
"client_id": this.creds.credentials.client_id,
72+
"client_secret": this.creds.credentials.client_secret,
73+
"username": this.creds.credentials.username,
74+
"password": this.creds.credentials.password
7475
};
75-
var api = new netatmo(auth);
76+
const api = new netatmo(auth);
7677

7778
api.on("error", function(error) {
7879
node.error(error);
@@ -87,6 +88,7 @@ module.exports = function(RED) {
8788
key: node.key
8889
};
8990

91+
// Api is marked as deprecated by netatmo
9092
api.getCameraPicture(options, function(err, picture) {
9193
msg.payload = picture;
9294
node.send(msg);
@@ -102,15 +104,15 @@ module.exports = function(RED) {
102104
this.creds = RED.nodes.getNode(config.creds);
103105
var node = this;
104106
this.on('input', function(msg) {
105-
var netatmo = require('netatmo');
107+
const netatmo = require('netatmo');
106108

107-
var auth = {
108-
"client_id": this.creds.client_id,
109-
"client_secret": this.creds.client_secret,
110-
"username": this.creds.username,
111-
"password": this.creds.password
109+
const auth = {
110+
"client_id": this.creds.credentials.client_id,
111+
"client_secret": this.creds.credentials.client_secret,
112+
"username": this.creds.credentials.username,
113+
"password": this.creds.credentials.password
112114
};
113-
var api = new netatmo(auth);
115+
const api = new netatmo(auth);
114116

115117
api.on("error", function(error) {
116118
node.error(error);
@@ -120,6 +122,7 @@ module.exports = function(RED) {
120122
node.warn(error);
121123
});
122124

125+
// Api is marked as deprecated by netatmo
123126
api.getHomeData(function(err, data) {
124127
msg.payload = data;
125128
node.send(msg);
@@ -128,8 +131,7 @@ module.exports = function(RED) {
128131

129132
}
130133
RED.nodes.registerType("get home data",NetatmoGetHomeData);
131-
/***************************************************************/
132-
/***************************************************************/
134+
133135
/***************************************************************/
134136
function NetatmoConfigNode(config) {
135137
RED.nodes.createNode(this,config);

0 commit comments

Comments
 (0)