package ir.ac.aut.ceit.aolab.jlamp.rpi.model;

import ir.ac.aut.ceit.aolab.lamp_notification;
import org.kaaproject.kaa.client.notification.NotificationListener;

/**
 * Created by root on 5/17/16.
 */
public class DefaultNotificationListener implements NotificationListener {
	@Override
	public void onNotification(long l, lamp_notification lamp_notification) {
		Lamp.getLampById(lamp_notification.getId()).sendLampCommand(1);
		try {
			Thread.sleep(lamp_notification.getInterval() * 1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		Lamp.getLampById(lamp_notification.getId()).sendLampCommand(0);
	}
}

@@ -68,21 +68,22 @@
 t.aolab.
-lamp_
+I1820.
 notifica
@@ -86,17 +86,24 @@
 fication
-;
+.I1820;%0A
 %0Aimport 
@@ -278,17 +278,20 @@
 tener %7B%0A
-%09
+    
 @Overrid
@@ -292,17 +292,20 @@
 verride%0A
-%09
+    
 public v
@@ -335,311 +335,28 @@
  l, 
-lamp_notification lamp_notification) %7B%0A%09%09Lamp.getLampById(lamp_notification.getId()).sendLampCommand(1);%0A%09%09try %7B%0A%09%09%09Thread.sleep(lamp_notification.getInterval() * 1000);%0A%09%09%7D catch (InterruptedException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09Lamp.getLampById(lamp_notification.getId()).sendLampCommand(0);%0A%09
+I1820 i1820) %7B%0A%0A    
 %7D%0A%7D%0A

Improve default notification for supporting I1820 notifications.