@@ -144,7 +144,6 @@ module.exports = function (RED) {
144
144
}
145
145
146
146
this . requestConfig = function ( ) {
147
- this . publish ( `$aws/things/${ this . credentials . thingId } /shadow/get` , { } )
148
147
this . publish ( `vsh/${ this . credentials . thingId } /requestConfig` , {
149
148
vshVersion : VSH_VERSION ,
150
149
} )
@@ -435,13 +434,19 @@ module.exports = function (RED) {
435
434
this . handlePing ( message )
436
435
break
437
436
case 'overrideConfig' :
437
+ this . publish ( `$aws/things/${ this . credentials . thingId } /shadow/get` , { } )
438
+
438
439
if ( message . rateLimiter ) {
439
440
const iterations = message . rateLimiter
440
441
this . rater . overrideConfig ( iterations )
441
442
}
442
443
if ( message . userIdToken ) {
443
444
this . userIdToken = message . userIdToken
444
445
}
446
+ if ( message . allowedDeviceCount ) {
447
+ this . allowedDeviceCount = message . allowedDeviceCount
448
+ this . unrigisterUnallowedDevices ( message . allowedDeviceCount )
449
+ }
445
450
break
446
451
case 'kill' :
447
452
this . handleKill ( message )
@@ -503,12 +508,8 @@ module.exports = function (RED) {
503
508
}
504
509
505
510
try {
506
- const {
507
- isAllowedVersion,
508
- isLatestVersion,
509
- updateHint,
510
- allowedDeviceCount,
511
- } = await this . checkVersion ( )
511
+ const { isAllowedVersion, isLatestVersion, updateHint } =
512
+ await this . checkVersion ( )
512
513
513
514
if ( ! isLatestVersion ) {
514
515
this . logger (
@@ -531,10 +532,6 @@ module.exports = function (RED) {
531
532
} )
532
533
return
533
534
}
534
-
535
- this . allowedDeviceCount = allowedDeviceCount
536
-
537
- this . unrigisterUnallowedDevices ( allowedDeviceCount )
538
535
} catch ( e ) {
539
536
return this . logger ( `version check failed! ${ e . message } ` , null , 'error' )
540
537
}
@@ -629,9 +626,6 @@ module.exports = function (RED) {
629
626
if ( match ) {
630
627
const deviceId = match [ 0 ]
631
628
632
- // if (topic.includes('/update')) {
633
- // this.handleUpdateFromAlexa(deviceId, message)
634
- // } else
635
629
if ( topic . includes ( '/directive' ) ) {
636
630
if ( message . directive . header . name == 'ReportState' ) {
637
631
this . handleReportState ( deviceId , message )
0 commit comments