@@ -21,6 +21,7 @@ const ArduinoCloud = require('../dist/index.js');
21
21
22
22
let connectionId ;
23
23
const deviceId = '1f4ced70-53ad-4b29-b221-1b0abbdfc757' ;
24
+ const thingId = '2cea8542-d472-4464-859c-4ef4dfc7d1d3'
24
25
const propertyIntName = 'integer' ;
25
26
const propertyIntValue = 22 ;
26
27
@@ -100,42 +101,42 @@ it('Simulate device write and client read his message from cloud monitor', (done
100
101
} ) ;
101
102
102
103
it ( 'Simulate client read integer property sent by device' , ( done ) => {
103
- ArduinoCloud . onPropertyValue ( connectionId , deviceId , propertyIntName , ( value ) => {
104
+ ArduinoCloud . onPropertyValue ( connectionId , thingId , propertyIntName , ( value ) => {
104
105
if ( value === propertyIntValue ) {
105
106
done ( ) ;
106
107
}
107
108
} ) . then ( ( ) => {
108
- ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , propertyIntName , propertyIntValue ) ;
109
+ ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , thingId , propertyIntName , propertyIntValue ) ;
109
110
} ) ;
110
111
} ) ;
111
112
112
113
it ( 'Simulate client read float property sent by device' , ( done ) => {
113
- ArduinoCloud . onPropertyValue ( connectionId , deviceId , propertyFloatName , ( value ) => {
114
+ ArduinoCloud . onPropertyValue ( connectionId , thingId , propertyFloatName , ( value ) => {
114
115
if ( value === propertyFloatVal ) {
115
116
done ( ) ;
116
117
}
117
118
} ) . then ( ( ) => {
118
- ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , propertyFloatName , propertyFloatVal ) ;
119
+ ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , thingId , propertyFloatName , propertyFloatVal ) ;
119
120
} ) ;
120
121
} ) ;
121
122
122
123
it ( 'Simulate client read string property sent by device' , ( done ) => {
123
- ArduinoCloud . onPropertyValue ( connectionId , deviceId , propertyStrName , ( value ) => {
124
+ ArduinoCloud . onPropertyValue ( connectionId , thingId , propertyStrName , ( value ) => {
124
125
if ( value === propertyStrVal ) {
125
126
done ( ) ;
126
127
}
127
128
} ) . then ( ( ) => {
128
- ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , propertyStrName , propertyStrVal ) ;
129
+ ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , thingId , propertyStrName , propertyStrVal ) ;
129
130
} ) ;
130
131
} ) ;
131
132
132
133
it ( 'Simulate client read boolean property sent by device' , ( done ) => {
133
- ArduinoCloud . onPropertyValue ( connectionId , deviceId , propertyBoolName , ( value ) => {
134
+ ArduinoCloud . onPropertyValue ( connectionId , thingId , propertyBoolName , ( value ) => {
134
135
if ( value === propertyBoolVal ) {
135
136
ArduinoCloud . disconnect ( connectionId ) ;
136
137
done ( ) ;
137
138
}
138
139
} ) . then ( ( ) => {
139
- ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , propertyBoolName , propertyBoolVal ) ;
140
+ ArduinoCloud . sendPropertyAsDevice ( connectionId , deviceId , thingId , propertyBoolName , propertyBoolVal ) ;
140
141
} ) ;
141
142
} ) ;
0 commit comments