Adde toString methods to all SensorData types
This commit is contained in:
parent
fa9f7aed2b
commit
73a36dfcca
6 changed files with 28 additions and 0 deletions
|
|
@ -46,4 +46,9 @@ public class DimmerEventData extends HalEventData {
|
||||||
public void setData(double dimmValue) {
|
public void setData(double dimmValue) {
|
||||||
this.dimmValue = dimmValue;
|
this.dimmValue = dimmValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return dimmValue+"%";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,9 @@ public class HumiditySensorData extends HalSensorData {
|
||||||
public void setData(double humidity) {
|
public void setData(double humidity) {
|
||||||
this.humidity = humidity;
|
this.humidity = humidity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return humidity+"%";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,8 @@ public class LightSensorData extends HalSensorData {
|
||||||
this.lux = lux;
|
this.lux = lux;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return lux+" lux";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,8 @@ public class PowerConsumptionSensorData extends HalSensorData {
|
||||||
this.wattHours = wattHours;
|
this.wattHours = wattHours;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return wattHours+" Wh";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,4 +56,9 @@ public class SwitchEventData extends HalEventData {
|
||||||
public void setData(double enabled) {
|
public void setData(double enabled) {
|
||||||
this.enabled = enabled > 0;
|
this.enabled = enabled > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return enabled ? "ON" : "OFF";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,9 @@ public class TemperatureSensorData extends HalSensorData {
|
||||||
this.temperature = temperature;
|
this.temperature = temperature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString(){
|
||||||
|
return temperature+" \\u00b0C";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue