Skip to content

Commit

Permalink
last three nodes are deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
floetenbaer committed Jan 11, 2022
1 parent a0ed12c commit 5deb884
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 40 deletions.
3 changes: 1 addition & 2 deletions netatmo-set-person-away.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
<ul>
<li>Home ID: something like 577fff842baa3c18948b4571</li>
<li>Person ID (optional): something like 766764b1-dcef-4321-b057-e0c8e2e329cf</li>
<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>
<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>
</ul>
<p>Home ID </p>
<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>
</script>
35 changes: 20 additions & 15 deletions netatmoNodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@

</script>

<!-- ************************************************************* -->
<!-- *************************************************************
* Api is marked as deprecated by netatmo
************************************************************* -->

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

<script type="text/x-red" data-template-name="get next events">
<script type="text/html" data-template-name="get next events">
<div class="form-row">
<label for="node-input-creds"><i class="fa fa-server"></i> Creds</label>
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
</div>
<div class="form-row">
<label for="node-input-home_id"><i class="icon-tag"></i> Home ID:</label>
<input type="text" id="node-input-home_id" placeholder="577fff..."">
<input type="text" id="node-input-home_id" placeholder="577fff...">
</div>
<div class="form-row">
<label for="node-input-event_id"><i class="icon-tag"></i> Event ID:</label>
<input type="text" id="node-input-event_id" placeholder="57816...">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>

<script type="text/x-red" data-help-name="get next events">
<script type="text/html" data-help-name="get next events">
<p><b>Api is marked as deprecated by netatmo.</b></p>
<p>This node returns information about the netatmo welcome next events with these credentials.</p>
<p>Parameters:</p>
<ul>
Expand All @@ -255,7 +258,10 @@
<b>msg.payload</b>. msg.payload is JSON.</p>
<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>
</script>
<!-- ************************************************************* -->

<!-- *************************************************************
* Api is marked as deprecated by netatmo
************************************************************* -->

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

<script type="text/x-red" data-template-name="get camera picture">
<script type="text/html" data-template-name="get camera picture">
<div class="form-row">
<label for="node-input-creds"><i class="fa fa-server"></i> Creds</label>
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
Expand All @@ -291,19 +297,21 @@
<input type="text" id="node-input-key" placeholder="8627b4...">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>

<script type="text/x-red" data-help-name="get camera picture">
<script type="text/html" data-help-name="get camera picture">
<p><b>Api is marked as deprecated by netatmo.</b></p>
<p>This node returns information about the netatmo welcome camera picture with these credentials.</p>
<p>Outputs an object called <b>msg</b> containing <b>msg.topic</b> and
<b>msg.payload</b>. msg.payload is JSON.</p>
<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>
</script>

<!-- *************************************************************
* Api is marked Deprecated by netatmo
* Api is marked as deprecated by netatmo
************************************************************* -->

<script type="text/javascript">
Expand All @@ -330,13 +338,13 @@
<input type="text" id="node-input-creds" placeholder="Add netatmo creds">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>

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

<script type="text/javascript">
// console.log("registering netatmo config node");
RED.nodes.registerType('configNode',{
category: 'config',
credentials: {
Expand All @@ -364,8 +371,6 @@
return this.name||"netatmo configNode";
},
oneditprepare: function() {
// eslint-disable-next-line no-undef
oneditprepareDeviceId(true);
}
});
</script>
Expand Down
48 changes: 25 additions & 23 deletions netatmoNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ module.exports = function(RED) {
this.event_id = config.event_id;
var node = this;
this.on('input', function(msg) {
var netatmo = require('netatmo');
const netatmo = require('netatmo');

var auth = {
"client_id": this.creds.client_id,
"client_secret": this.creds.client_secret,
"username": this.creds.username,
"password": this.creds.password
const auth = {
"client_id": this.creds.credentials.client_id,
"client_secret": this.creds.credentials.client_secret,
"username": this.creds.credentials.username,
"password": this.creds.credentials.password
};
var api = new netatmo(auth);
const api = new netatmo(auth);
var options = {
home_id: node.home_id,
event_id: node.event_id
Expand All @@ -47,6 +47,7 @@ module.exports = function(RED) {
node.warn(error);
});

// Api is marked as deprecated by netatmo
api.getNextEvents(options, function(err, events) {
msg.payload = events;
node.send(msg);
Expand All @@ -64,15 +65,15 @@ module.exports = function(RED) {
this.key = config.key;
var node = this;
this.on('input', function(msg) {
var netatmo = require('netatmo');
const netatmo = require('netatmo');

var auth = {
"client_id": this.creds.client_id,
"client_secret": this.creds.client_secret,
"username": this.creds.username,
"password": this.creds.password
const auth = {
"client_id": this.creds.credentials.client_id,
"client_secret": this.creds.credentials.client_secret,
"username": this.creds.credentials.username,
"password": this.creds.credentials.password
};
var api = new netatmo(auth);
const api = new netatmo(auth);

api.on("error", function(error) {
node.error(error);
Expand All @@ -87,6 +88,7 @@ module.exports = function(RED) {
key: node.key
};

// Api is marked as deprecated by netatmo
api.getCameraPicture(options, function(err, picture) {
msg.payload = picture;
node.send(msg);
Expand All @@ -102,15 +104,15 @@ module.exports = function(RED) {
this.creds = RED.nodes.getNode(config.creds);
var node = this;
this.on('input', function(msg) {
var netatmo = require('netatmo');
const netatmo = require('netatmo');

var auth = {
"client_id": this.creds.client_id,
"client_secret": this.creds.client_secret,
"username": this.creds.username,
"password": this.creds.password
const auth = {
"client_id": this.creds.credentials.client_id,
"client_secret": this.creds.credentials.client_secret,
"username": this.creds.credentials.username,
"password": this.creds.credentials.password
};
var api = new netatmo(auth);
const api = new netatmo(auth);

api.on("error", function(error) {
node.error(error);
Expand All @@ -120,6 +122,7 @@ module.exports = function(RED) {
node.warn(error);
});

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

}
RED.nodes.registerType("get home data",NetatmoGetHomeData);
/***************************************************************/
/***************************************************************/

/***************************************************************/
function NetatmoConfigNode(config) {
RED.nodes.createNode(this,config);
Expand Down

0 comments on commit 5deb884

Please sign in to comment.