more bugfixes

This commit is contained in:
Ziver Koc 2016-08-19 16:09:11 +02:00
parent aeef862ab4
commit b405c12293
2 changed files with 3 additions and 2 deletions

View file

@ -56,7 +56,7 @@ public class SensorDataAggregatorDaemon implements HalDaemon {
public void aggregateSensor(Sensor sensor) { public void aggregateSensor(Sensor sensor) {
if(sensor.getDeviceConfig() == null){ if(sensor.getDeviceConfig() == null){
logger.fine("The sensor type is not supported - ignoring it"); logger.fine("The sensor config is not available - ignoring it");
return; return;
} }
logger.fine("The sensor is of type: " + sensor.getDeviceConfig().getClass().getName()); logger.fine("The sensor is of type: " + sensor.getDeviceConfig().getClass().getName());

View file

@ -6,6 +6,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import se.hal.HalContext; import se.hal.HalContext;
import se.hal.plugin.tellstick.device.Oregon0x1A2D;
import se.hal.util.UTCTimeUtility; import se.hal.util.UTCTimeUtility;
import zutil.db.DBConnection; import zutil.db.DBConnection;
import zutil.db.DBUpgradeHandler; import zutil.db.DBUpgradeHandler;
@ -42,7 +43,7 @@ public class SensorDataAggregationDeamonTest {
System.out.println("Adding user to database"); System.out.println("Adding user to database");
db.exec("INSERT INTO user(id, external, username) VALUES(222, 0, 'test')"); //adding user db.exec("INSERT INTO user(id, external, username) VALUES(222, 0, 'test')"); //adding user
System.out.println("Adding sensor to database"); System.out.println("Adding sensor to database");
db.exec("INSERT INTO sensor(id, user_id, external_id, type) VALUES(111, 222, 333, 'se.hal.plugin.tellstick.protocol.Oregon0x1A2DProtocol')"); //adding sensor db.exec("INSERT INTO sensor(id, user_id, external_id, type) VALUES(111, 222, 333, '"+Oregon0x1A2D.class.getName()+"')"); //adding sensor
System.out.println("Generating raw data and saving it to the database..."); System.out.println("Generating raw data and saving it to the database...");
PreparedStatement stmt = db.getPreparedStatement("INSERT INTO sensor_data_raw (timestamp, sensor_id, data) VALUES(?, ?, ?)"); PreparedStatement stmt = db.getPreparedStatement("INSERT INTO sensor_data_raw (timestamp, sensor_id, data) VALUES(?, ?, ?)");
try{ try{