diff --git a/src/se/hal/page/EventConfigHttpPage.java b/src/se/hal/page/EventConfigHttpPage.java index 8d4c53d4..226d66f5 100755 --- a/src/se/hal/page/EventConfigHttpPage.java +++ b/src/se/hal/page/EventConfigHttpPage.java @@ -65,6 +65,8 @@ public class EventConfigHttpPage extends HalHttpPage { configurator.setValues(request); configurator.applyConfiguration(); event.save(db); + ControllerManager.getInstance().register(event); + break; case "modify_local_event": event = Event.getEvent(db, id); if(event != null){ @@ -77,8 +79,10 @@ public class EventConfigHttpPage extends HalHttpPage { break; case "remove_local_event": event = Event.getEvent(db, id); - if(event != null) + if(event != null) { + ControllerManager.getInstance().deregister(event); event.delete(db); + } break; } } diff --git a/src/se/hal/page/SensorConfigHttpPage.java b/src/se/hal/page/SensorConfigHttpPage.java index de564c84..1ffaed92 100755 --- a/src/se/hal/page/SensorConfigHttpPage.java +++ b/src/se/hal/page/SensorConfigHttpPage.java @@ -67,6 +67,8 @@ public class SensorConfigHttpPage extends HalHttpPage { configurator.setValues(request); configurator.applyConfiguration(); sensor.save(db); + ControllerManager.getInstance().register(sensor); + break; case "modify_local_sensor": sensor = Sensor.getSensor(db, id); if(sensor != null){ @@ -79,8 +81,10 @@ public class SensorConfigHttpPage extends HalHttpPage { break; case "remove_local_sensor": sensor = Sensor.getSensor(db, id); - if(sensor != null) + if(sensor != null) { + ControllerManager.getInstance().deregister(sensor); sensor.delete(db); + } break; // External Users