diff --git a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/EcoSenseController.java b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/EcoSenseController.java index f1337a06..8d0d5d78 100644 --- a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/EcoSenseController.java +++ b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/EcoSenseController.java @@ -27,7 +27,7 @@ package se.hal.plugin.vendor.ecosense; import se.hal.HalContext; import se.hal.HalServer; import se.hal.intf.*; -import se.hal.plugin.vendor.ecosense.device.EccoCubeRadonSensor; +import se.hal.plugin.vendor.ecosense.device.EccoCubeRadonSensorConfig; import se.hal.struct.devicedata.RadonSensorData; import zutil.ObjectUtil; import zutil.log.LogUtil; @@ -83,7 +83,7 @@ public class EcoSenseController implements HalSensorController, Runnable, HalDae return; } - EccoCubeRadonSensor radonSensor = new EccoCubeRadonSensor(); + EccoCubeRadonSensorConfig radonSensor = new EccoCubeRadonSensorConfig(); radonSensor.setSerialNumber(apiResponse.serialNumber); RadonSensorData radonSensorData = new RadonSensorData(apiResponse.radonLevel, apiResponse.lastRadonUpdateTime); diff --git a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensor.java b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensorConfig.java similarity index 85% rename from plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensor.java rename to plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensorConfig.java index abefcded..f35b5e76 100644 --- a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensor.java +++ b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/device/EccoCubeRadonSensorConfig.java @@ -29,14 +29,16 @@ import se.hal.intf.HalSensorController; import se.hal.intf.HalSensorData; import se.hal.plugin.vendor.ecosense.EcoSenseController; import se.hal.struct.devicedata.RadonSensorData; +import zutil.ui.conf.Configurator; import java.util.Objects; /** * A sensor that calculate current radon level */ -public class EccoCubeRadonSensor implements HalSensorConfig { +public class EccoCubeRadonSensorConfig implements HalSensorConfig { + @Configurator.Configurable(value = "Device serial number") private String serialNumber; @@ -66,9 +68,9 @@ public class EccoCubeRadonSensor implements HalSensorConfig { @Override public final boolean equals(Object o) { - if (!(o instanceof EccoCubeRadonSensor)) return false; + if (!(o instanceof EccoCubeRadonSensorConfig)) return false; - EccoCubeRadonSensor that = (EccoCubeRadonSensor) o; + EccoCubeRadonSensorConfig that = (EccoCubeRadonSensorConfig) o; return Objects.equals(serialNumber, that.serialNumber); } @@ -76,4 +78,9 @@ public class EccoCubeRadonSensor implements HalSensorConfig { public int hashCode() { return Objects.hashCode(serialNumber); } + + @Override + public String toString() { + return "Serial number: " + serialNumber; + } } diff --git a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/plugin.json b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/plugin.json index 71801055..d8f8d87f 100644 --- a/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/plugin.json +++ b/plugins/hal-vendor-ecosense/src/se/hal/plugin/vendor/ecosense/plugin.json @@ -5,6 +5,6 @@ "interfaces": [ {"se.hal.intf.HalAutostartController": "se.hal.plugin.vendor.ecosense.EcoSenseController"}, - {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.ecosense.device.EccoCubeRadonSensor"} + {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.ecosense.device.EccoCubeRadonSensorConfig"} ] } \ No newline at end of file diff --git a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/TibberController.java b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/TibberController.java index 061a8ed6..e6a72d7a 100644 --- a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/TibberController.java +++ b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/TibberController.java @@ -27,9 +27,9 @@ package se.hal.plugin.vendor.tibber; import se.hal.HalContext; import se.hal.HalServer; import se.hal.intf.*; -import se.hal.plugin.vendor.tibber.device.TibberElectricityCostSensor; -import se.hal.plugin.vendor.tibber.device.TibberElectricityPriceSensor; -import se.hal.plugin.vendor.tibber.device.TibberPowerConsumptionSensor; +import se.hal.plugin.vendor.tibber.device.TibberElectricityCostSensorConfig; +import se.hal.plugin.vendor.tibber.device.TibberElectricityPriceSensorConfig; +import se.hal.plugin.vendor.tibber.device.TibberPowerConsumptionSensorConfig; import se.hal.struct.devicedata.PriceSensorData; import se.hal.util.ListenerUtil; import zutil.log.LogUtil; @@ -92,13 +92,13 @@ public class TibberController implements HalSensorController, Runnable, HalDaemo } if (consumption.cost > 0) { - ListenerUtil.callReportReceived(deviceListeners, new TibberElectricityCostSensor(), new PriceSensorData(consumption.cost, consumption.timestamp)); + ListenerUtil.callReportReceived(deviceListeners, new TibberElectricityCostSensorConfig(), new PriceSensorData(consumption.cost, consumption.timestamp)); } if (consumption.unitPriceVAT > 0) { - ListenerUtil.callReportReceived(deviceListeners, new TibberElectricityPriceSensor(), new PriceSensorData(consumption.unitPriceVAT, consumption.timestamp)); + ListenerUtil.callReportReceived(deviceListeners, new TibberElectricityPriceSensorConfig(), new PriceSensorData(consumption.unitPriceVAT, consumption.timestamp)); } if (consumption.consumption > 0) { - ListenerUtil.callReportReceived(deviceListeners, new TibberPowerConsumptionSensor(), new PriceSensorData(consumption.consumption, consumption.timestamp)); + ListenerUtil.callReportReceived(deviceListeners, new TibberPowerConsumptionSensorConfig(), new PriceSensorData(consumption.consumption, consumption.timestamp)); } } catch (Exception e) { diff --git a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensor.java b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensorConfig.java similarity index 93% rename from plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensor.java rename to plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensorConfig.java index 49cc6dd2..36285960 100644 --- a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensor.java +++ b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityCostSensorConfig.java @@ -33,7 +33,7 @@ import se.hal.struct.devicedata.CostSensorData; /** * A sensor that calculate current electricity bil */ -public class TibberElectricityCostSensor implements HalSensorConfig { +public class TibberElectricityCostSensorConfig implements HalSensorConfig { @@ -59,6 +59,6 @@ public class TibberElectricityCostSensor implements HalSensorConfig { @Override public boolean equals(Object obj) { - return obj instanceof TibberElectricityCostSensor; + return obj instanceof TibberElectricityCostSensorConfig; } } diff --git a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensor.java b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensorConfig.java similarity index 93% rename from plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensor.java rename to plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensorConfig.java index b7879fa5..0cb08beb 100644 --- a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensor.java +++ b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberElectricityPriceSensorConfig.java @@ -33,7 +33,7 @@ import se.hal.struct.devicedata.PriceSensorData; /** * A sensor that shows the price of electricity at a specific time */ -public class TibberElectricityPriceSensor implements HalSensorConfig { +public class TibberElectricityPriceSensorConfig implements HalSensorConfig { @@ -59,6 +59,6 @@ public class TibberElectricityPriceSensor implements HalSensorConfig { @Override public boolean equals(Object obj) { - return obj instanceof TibberElectricityPriceSensor; + return obj instanceof TibberElectricityPriceSensorConfig; } } diff --git a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensor.java b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensorConfig.java similarity index 93% rename from plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensor.java rename to plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensorConfig.java index 7df1ecf1..fad3cd15 100644 --- a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensor.java +++ b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/device/TibberPowerConsumptionSensorConfig.java @@ -31,7 +31,7 @@ import se.hal.struct.devicedata.PowerConsumptionSensorData; import se.hal.plugin.vendor.tibber.TibberController; -public class TibberPowerConsumptionSensor implements HalSensorConfig { +public class TibberPowerConsumptionSensorConfig implements HalSensorConfig { @Override @@ -56,6 +56,6 @@ public class TibberPowerConsumptionSensor implements HalSensorConfig { @Override public boolean equals(Object obj) { - return obj instanceof TibberPowerConsumptionSensor; + return obj instanceof TibberPowerConsumptionSensorConfig; } } diff --git a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/plugin.json b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/plugin.json index a1dfac72..e9392f9b 100644 --- a/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/plugin.json +++ b/plugins/hal-vendor-tibber/src/se/hal/plugin/vendor/tibber/plugin.json @@ -5,8 +5,8 @@ "interfaces": [ {"se.hal.intf.HalAutostartController": "se.hal.plugin.vendor.tibber.TibberController"}, - {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberElectricityCostSensor"}, - {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberElectricityPriceSensor"}, - {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberPowerConsumptionSensor"} + {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberElectricityCostSensorConfig"}, + {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberElectricityPriceSensorConfig"}, + {"se.hal.intf.HalSensorConfig": "se.hal.plugin.vendor.tibber.device.TibberPowerConsumptionSensorConfig"} ] } \ No newline at end of file