Commit 5ea6df6 1 parent 0153cc1 commit 5ea6df6 Copy full SHA for 5ea6df6
File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,6 @@ Module.register('MMM-MyTTC', {
54
54
55
55
Log . info ( 'Starting module: ' + this . name ) ;
56
56
57
- this . UNIQUE_STRING = Math . random ( ) . toString ( 36 ) . replace ( / [ ^ a - z ] + / g, '' ) . substr ( 0 , 5 ) ;
58
-
59
57
this . loaded = false ;
60
58
this . ttcData = null ;
61
59
@@ -69,12 +67,12 @@ Module.register('MMM-MyTTC', {
69
67
} ,
70
68
71
69
getData : function ( ) {
72
- this . sendSocketNotification ( "MMM-MYTTC-GET" , { unique : this . UNIQUE_STRING , config :this . config } ) ;
70
+ this . sendSocketNotification ( "MMM-MYTTC-GET" , { instanceId : this . identifier , config : this . config } ) ;
73
71
} ,
74
72
75
73
socketNotificationReceived : function ( notification , payload ) {
76
74
//only update if a data set is returned. Otherwise leave stale data on the screen.
77
- if ( notification === 'MMM-MYTTC-RESPONSE' + this . UNIQUE_STRING && payload != null ) {
75
+ if ( notification === 'MMM-MYTTC-RESPONSE' + this . identifier && payload != null ) {
78
76
this . ttcData = payload ;
79
77
80
78
//only fade in tye module after the first data pull
Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ module.exports = NodeHelper.create({
41
41
if ( xmlHttp . readyState == 4 && xmlHttp . status == 200 ) { //good
42
42
43
43
var processedData = self . processJSON ( xmlHttp . responseText , payload . config ) ;
44
- self . sendSocketNotification ( 'MMM-MYTTC-RESPONSE' + payload . unique , processedData ) ;
44
+ self . sendSocketNotification ( 'MMM-MYTTC-RESPONSE' + payload . instanceId , processedData ) ;
45
45
46
46
} else if ( xmlHttp . readyState == 4 ) { //bad...
47
- self . sendSocketNotification ( 'MMM-MYTTC-RESPONSE' + payload . unique , { data :null } ) ;
47
+ self . sendSocketNotification ( 'MMM-MYTTC-RESPONSE' + payload . instanceId , { data :null } ) ;
48
48
}
49
49
}
50
50
xmlHttp . open ( "GET" , builtURL , true ) ; // true for asynchronous
You can’t perform that action at this time.
0 commit comments