11/*
22* Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
3- * This file is part of node-red-contrib-arduino-cloud.
3+ * This file is part of node-red-contrib-arduino-iot- cloud.
44* Copyright (c) 2019
55*
66* This software is released under:
77* The GNU General Public License, which covers the main part of
8- * node-red-contrib-arduino-cloud
8+ * node-red-contrib-arduino-iot- cloud
99* The terms of this license can be found at:
1010* https://www.gnu.org/licenses/gpl-3.0.en.html
1111*
@@ -50,7 +50,7 @@ module.exports = function (RED) {
5050 this . status ( { } ) ;
5151 } , config . id ) ;
5252 } else {
53- this . status ( { fill : "red" , shape : "ring" , text : "arduino-cloud.status.connection-error" } ) ;
53+ this . status ( { fill : "red" , shape : "ring" , text : "arduino-iot- cloud.status.connection-error" } ) ;
5454 }
5555 this . on ( 'close' , function ( done ) {
5656 connectionManager . deleteClientMqtt ( connectionConfig . credentials . clientid , this . thing , this . propertyVariableName , config . id ) . then ( ( ) => { done ( ) ; } ) ;
@@ -88,7 +88,7 @@ module.exports = function (RED) {
8888 if ( typeof msg . payload !== "object" ) {
8989 s = getStatus ( msg . payload ) ;
9090 } else {
91- s = "arduino-cloud.status.object-sent" ;
91+ s = "arduino-iot- cloud.status.object-sent" ;
9292 }
9393 if ( s != undefined )
9494 this . status ( { fill : "grey" , shape : "dot" , text : s } ) ;
@@ -106,14 +106,14 @@ module.exports = function (RED) {
106106 console . log ( err ) ;
107107 }
108108
109- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-setting-value" } ) ;
109+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-setting-value" } ) ;
110110 }
111111 } ) ;
112112 this . on ( 'close' , function ( done ) {
113113 connectionManager . deleteClientHttp ( connectionConfig . credentials . clientid ) . then ( ( ) => { done ( ) ; } ) ;
114114 } ) ;
115115 } else {
116- this . status ( { fill : "red" , shape : "ring" , text : "arduino-cloud.status.connection-error" } ) ;
116+ this . status ( { fill : "red" , shape : "ring" , text : "arduino-iot- cloud.status.connection-error" } ) ;
117117 }
118118 }
119119 } catch ( err ) {
@@ -181,9 +181,9 @@ module.exports = function (RED) {
181181 } ]
182182 }
183183 ) ;
184- var str = RED . _ ( "arduino-cloud.status.sent" ) ;
184+ var str = RED . _ ( "arduino-iot- cloud.status.sent" ) ;
185185 str += data . length ;
186- str += RED . _ ( "arduino-cloud.status.elements" ) ;
186+ str += RED . _ ( "arduino-iot- cloud.status.elements" ) ;
187187 this . status ( { fill : "grey" , shape : "dot" , text : str } ) ;
188188 }
189189 } catch ( err ) {
@@ -198,7 +198,7 @@ module.exports = function (RED) {
198198 console . log ( err ) ;
199199 }
200200
201- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-getting-value" } ) ;
201+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-getting-value" } ) ;
202202 }
203203 } ) ;
204204
@@ -207,7 +207,7 @@ module.exports = function (RED) {
207207 } ) ;
208208 }
209209 } else {
210- this . status ( { fill : "red" , shape : "ring" , text : "arduino-cloud.status.connection-error" } ) ;
210+ this . status ( { fill : "red" , shape : "ring" , text : "arduino-iot- cloud.status.connection-error" } ) ;
211211 }
212212 } catch ( err ) {
213213 if ( err . response && err . response . res && err . response . request ) {
@@ -221,7 +221,7 @@ module.exports = function (RED) {
221221 console . log ( err ) ;
222222 }
223223
224- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-getting-value" } ) ;
224+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-getting-value" } ) ;
225225 }
226226 }
227227 }
@@ -257,7 +257,7 @@ module.exports = function (RED) {
257257 }
258258 }
259259 } else {
260- this . status ( { fill : "red" , shape : "ring" , text : "arduino-cloud.status.connection-error" } ) ;
260+ this . status ( { fill : "red" , shape : "ring" , text : "arduino-iot- cloud.status.connection-error" } ) ;
261261 }
262262 } catch ( err ) {
263263 if ( err . response && err . response . res && err . response . request ) {
@@ -306,7 +306,7 @@ module.exports = function (RED) {
306306 }
307307
308308 this . pollTimeoutPoll = setTimeout ( ( ) => { this . poll ( connectionConfig , pollTime ) } , pollTime * 1000 ) ;
309- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-getting-value" } ) ;
309+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-getting-value" } ) ;
310310 }
311311 }
312312 }
@@ -356,14 +356,14 @@ module.exports = function (RED) {
356356 console . log ( err ) ;
357357 }
358358
359- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-getting-value" } ) ;
359+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-getting-value" } ) ;
360360 }
361361 } ) ;
362362 this . on ( 'close' , function ( done ) {
363363 connectionManager . deleteClientHttp ( connectionConfig . credentials . clientid ) . then ( ( ) => { done ( ) ; } ) ;
364364 } ) ;
365365 } else {
366- this . status ( { fill : "red" , shape : "ring" , text : "arduino-cloud.status.connection-error" } ) ;
366+ this . status ( { fill : "red" , shape : "ring" , text : "arduino-iot- cloud.status.connection-error" } ) ;
367367 }
368368 }
369369 } catch ( err ) {
@@ -378,7 +378,7 @@ module.exports = function (RED) {
378378 console . log ( err ) ;
379379 }
380380
381- this . status ( { fill : "red" , shape : "dot" , text : "arduino-cloud.status.error-getting-value" } ) ;
381+ this . status ( { fill : "red" , shape : "dot" , text : "arduino-iot- cloud.status.error-getting-value" } ) ;
382382 }
383383 }
384384 }
@@ -414,13 +414,13 @@ module.exports = function (RED) {
414414 } else if ( req . query . connectionid ) {
415415 const connectionConfig = RED . nodes . getNode ( req . query . connectionid ) ;
416416 if ( ! connectionConfig ) {
417- str = RED . _ ( "arduino-cloud.connection-error.no-cred-available" ) ;
417+ str = RED . _ ( "arduino-iot- cloud.connection-error.no-cred-available" ) ;
418418 console . log ( str ) ;
419419 return res . send ( JSON . stringify ( { error : str } ) ) ;
420420 }
421421 arduinoRestClient = await connectionManager . getClientHttp ( connectionConfig ) ;
422422 } else {
423- str = RED . _ ( "arduino-cloud.connection-error.no-cred-available" ) ;
423+ str = RED . _ ( "arduino-iot- cloud.connection-error.no-cred-available" ) ;
424424 console . log ( str ) ;
425425 return res . send ( JSON . stringify ( { error : str } ) ) ;
426426 }
@@ -430,12 +430,12 @@ module.exports = function (RED) {
430430 const thing_id = req . query . thing_id ;
431431 return res . send ( JSON . stringify ( await arduinoRestClient . getProperties ( thing_id ) ) ) ;
432432 } else {
433- str = RED . _ ( "arduino-cloud.connection-error.wrong-param" ) ;
433+ str = RED . _ ( "arduino-iot- cloud.connection-error.wrong-param" ) ;
434434 console . log ( str ) ;
435435 return res . send ( JSON . stringify ( { error : str } ) ) ;
436436 }
437437 } catch ( err ) {
438- str = RED . _ ( "arduino-cloud.connection-error.wrong-cred-sys-unvail" ) ;
438+ str = RED . _ ( "arduino-iot- cloud.connection-error.wrong-cred-sys-unvail" ) ;
439439 console . log ( `Status: ${ err . status } , message: ${ err . error } ` ) ;
440440 return res . send ( JSON . stringify ( { error : str } ) ) ;
441441 }
@@ -456,5 +456,5 @@ function getStatus(value) {
456456 else
457457 return value ;
458458 }
459- return RED . _ ( "arduino-cloud.status.object-injected" ) ;
459+ return RED . _ ( "arduino-iot- cloud.status.object-injected" ) ;
460460}
0 commit comments