fixed creating new event or sensor from autodetect
This commit is contained in:
parent
88d2b2cebf
commit
52a2cb207f
2 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import se.hal.page.HalAlertManager.HalAlert;
|
|||
import se.hal.struct.ClassConfigurationData;
|
||||
import se.hal.struct.Event;
|
||||
import se.hal.struct.User;
|
||||
import zutil.ObjectUtil;
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.parser.Templator;
|
||||
|
|
@ -43,8 +44,9 @@ public class EventConfigHttpPage extends HalHttpPage {
|
|||
|
||||
// Save new input
|
||||
if(request.containsKey("action")){
|
||||
int id = (request.containsKey("id") ? Integer.parseInt(request.get("id")) : -1);
|
||||
int id = (!ObjectUtil.isEmpty(request.get("id")) ? Integer.parseInt(request.get("id")) : -1);
|
||||
Event event;
|
||||
|
||||
switch(request.get("action")) {
|
||||
// Local events
|
||||
case "create_local_event":
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import se.hal.page.HalAlertManager.HalAlert;
|
|||
import se.hal.struct.ClassConfigurationData;
|
||||
import se.hal.struct.Sensor;
|
||||
import se.hal.struct.User;
|
||||
import zutil.ObjectUtil;
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.parser.Templator;
|
||||
|
|
@ -43,9 +44,10 @@ public class SensorConfigHttpPage extends HalHttpPage {
|
|||
|
||||
// Save new input
|
||||
if(request.containsKey("action")){
|
||||
int id = (request.containsKey("id") ? Integer.parseInt(request.get("id")) : -1);
|
||||
int id = (!ObjectUtil.isEmpty(request.get("id")) ? Integer.parseInt(request.get("id")) : -1);
|
||||
Sensor sensor;
|
||||
User user;
|
||||
|
||||
switch(request.get("action")) {
|
||||
// Local Sensors
|
||||
case "create_local_sensor":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue