File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,7 @@ const connect = options => new Promise((resolve, reject) => {
134
134
const valueKey = p . v !== undefined ? 'v' : '2' ;
135
135
const valueStringKey = p . vs !== undefined ? 'vs' : '3' ;
136
136
const valueBooleanKey = p . vb !== undefined ? 'vb' : '4' ;
137
- let value ;
137
+ let value = null ;
138
138
propertyNameKey = propertyNameKeySplit [ propertyNameId ] ;
139
139
if ( propertyCallback [ msg . topic ] [ propertyNameKey ] ) {
140
140
if ( ! ( p [ valueKey ] === undefined ) ) {
@@ -148,19 +148,19 @@ const connect = options => new Promise((resolve, reject) => {
148
148
if ( propertyNameKeyPrevious === '' ) {
149
149
propertyNameKeyPrevious = propertyNameKeySplit [ propertyNameId ] ;
150
150
}
151
- if ( propertyNameKeyPrevious !== propertyNameKey ) {
151
+ if ( propertyNameKeyPrevious !== propertyNameKey && propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ) {
152
152
propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ( valueToSend ) ;
153
153
propertyNameKeyPrevious = propertyNameKey ;
154
154
valueToSend = { } ;
155
155
}
156
- if ( propertyNameKeySplit . length === 1 ) {
156
+ if ( propertyNameKeySplit . length === 1 && value != null ) {
157
157
valueToSend = value ;
158
158
} else {
159
159
const attributeName = propertyNameKeySplit [ attributeNameId ] ;
160
160
valueToSend [ attributeName ] = value ;
161
161
}
162
162
} ) ;
163
- if ( valueToSend !== { } ) {
163
+ if ( valueToSend !== { } && propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ) {
164
164
propertyCallback [ msg . topic ] [ propertyNameKeyPrevious ] ( valueToSend ) ;
165
165
}
166
166
}
You can’t perform that action at this time.
0 commit comments