@@ -194,8 +194,18 @@ private void receiveData(MulticastSocket socket, DatagramPacket dgram) {
194
194
continue ;
195
195
}
196
196
197
- //report and non gateway heartbeat
198
- processOtherCommands (jobject );
197
+ if (command .equals ("write_ack" )) {
198
+ continue ;
199
+ }
200
+
201
+ if (command .equals ("report" ) || command .equals ("heartbeat" )) {
202
+ //report and non gateway heartbeat
203
+ processOtherCommands (jobject );
204
+ continue ;
205
+ } else {
206
+ logger .error ("Unknown Xiaomi gateway command: " + command );
207
+ }
208
+
199
209
}
200
210
} catch (IOException e ) {
201
211
e .printStackTrace ();
@@ -244,7 +254,7 @@ private void processOtherCommands(JsonObject jobject) {
244
254
logger .debug ("XiaomiGateway: processing motion event" );
245
255
processMotionEvent (itemName , jobject );
246
256
}
247
- if ( isCubeEvent (jobject )) {
257
+ if ( isCubeEvent (jobject )) {
248
258
processCubeEvent (itemName , type , jobject );
249
259
}
250
260
}
@@ -255,13 +265,11 @@ private void processOtherCommands(JsonObject jobject) {
255
265
private void processCubeEvent (String itemName , String type , JsonObject jobject ) {
256
266
String event = getStatusEvent (jobject );
257
267
boolean publish = false ;
258
- if ( isRotateCubeEvent (jobject ))
259
- {
268
+ if (isRotateCubeEvent (jobject )) {
260
269
event = "rotate" ;
261
270
}
262
271
logger .debug ("XiaomiGateway: processing cube event " + event );
263
- switch (event )
264
- {
272
+ switch (event ) {
265
273
case "flip90" :
266
274
publish = type .endsWith (".flip90" );
267
275
break ;
@@ -293,7 +301,7 @@ private void processCubeEvent(String itemName, String type, JsonObject jobject)
293
301
logger .error ("Unknown cube event: " + event );
294
302
}
295
303
296
- if ( publish )
304
+ if ( publish )
297
305
eventPublisher .sendCommand (itemName , OnOffType .ON );
298
306
}
299
307
@@ -624,6 +632,11 @@ protected void internalReceiveCommand(String itemName, Command command) {
624
632
logger .error ("Only OnOff command types currently supported" );
625
633
return ;
626
634
}
635
+ if ( !itemName .contains ("channel" ))
636
+ {
637
+ //only channel items
638
+ return ;
639
+ }
627
640
628
641
if (itemType .endsWith (".channel_0" ) || itemType .endsWith (".channel_1" )) {
629
642
//86ctrl_neutral1/2
0 commit comments