Fixed compilation issues
This commit is contained in:
parent
7d64788154
commit
98c48e595f
5 changed files with 76 additions and 5 deletions
36
hal-core/src/se/hal/struct/devicedata/CostSensorData.java
Normal file
36
hal-core/src/se/hal/struct/devicedata/CostSensorData.java
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
package se.hal.struct.devicedata;
|
||||||
|
|
||||||
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
|
|
||||||
|
public class CostSensorData extends HalSensorData {
|
||||||
|
|
||||||
|
private double cost;
|
||||||
|
|
||||||
|
|
||||||
|
public CostSensorData(){}
|
||||||
|
public CostSensorData(double cost, long timestamp){
|
||||||
|
this.cost = cost;
|
||||||
|
super.setTimestamp(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return cost + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Storage methods
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getData() {
|
||||||
|
return cost;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setData(double cost) {
|
||||||
|
this.cost = cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
36
hal-core/src/se/hal/struct/devicedata/PriceSensorData.java
Normal file
36
hal-core/src/se/hal/struct/devicedata/PriceSensorData.java
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
package se.hal.struct.devicedata;
|
||||||
|
|
||||||
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
|
|
||||||
|
public class PriceSensorData extends HalSensorData {
|
||||||
|
|
||||||
|
private double price;
|
||||||
|
|
||||||
|
|
||||||
|
public PriceSensorData(){}
|
||||||
|
public PriceSensorData(double price, long timestamp){
|
||||||
|
this.price = price;
|
||||||
|
super.setTimestamp(timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return price + "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------
|
||||||
|
// Storage methods
|
||||||
|
// ----------------------------------------
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getData() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setData(double price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,7 +28,7 @@ import se.hal.intf.HalSensorConfig;
|
||||||
import se.hal.intf.HalSensorController;
|
import se.hal.intf.HalSensorController;
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
import se.hal.plugin.tibber.TibberController;
|
import se.hal.plugin.tibber.TibberController;
|
||||||
import se.hal.struct.devicedata.HumiditySensorData;
|
import se.hal.struct.devicedata.CostSensorData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sensor that calculate current electricity bil
|
* A sensor that calculate current electricity bil
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,11 @@
|
||||||
|
|
||||||
package se.hal.plugin.tibber.device;
|
package se.hal.plugin.tibber.device;
|
||||||
|
|
||||||
import se.hal.intf.HalDeviceData;
|
|
||||||
import se.hal.intf.HalSensorConfig;
|
import se.hal.intf.HalSensorConfig;
|
||||||
import se.hal.intf.HalSensorController;
|
import se.hal.intf.HalSensorController;
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
import se.hal.struct.devicedata.HumiditySensorData;
|
|
||||||
import se.hal.plugin.tibber.TibberController;
|
import se.hal.plugin.tibber.TibberController;
|
||||||
|
import se.hal.struct.devicedata.PriceSensorData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A sensor that shows the price of electricity at a specific time
|
* A sensor that shows the price of electricity at a specific time
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ package se.hal.plugin.tibber.device;
|
||||||
import se.hal.intf.HalSensorConfig;
|
import se.hal.intf.HalSensorConfig;
|
||||||
import se.hal.intf.HalSensorController;
|
import se.hal.intf.HalSensorController;
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
import se.hal.struct.devicedata.TemperatureSensorData;
|
import se.hal.struct.devicedata.PowerConsumptionSensorData;
|
||||||
import se.hal.plugin.tibber.TibberController;
|
import se.hal.plugin.tibber.TibberController;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class PowerConsumptionSensor implements HalSensorConfig {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends HalSensorData> getDeviceDataClass() {
|
public Class<? extends HalSensorData> getDeviceDataClass() {
|
||||||
return TemperatureSensorData.class;
|
return PowerConsumptionSensorData.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue