diff --git a/README.md b/README.md index 68e0c39..2349a4d 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ This is only tangentially related. A java library for running a zwave controlle # Ok, how do I run this thing? The easiest way to run the software on a hub is to download a pre-built SD card image. One can be downloaded here:
-[hub_1.0.6.zip](https://cf.lanternpowermonitor.com/hub_1.0.6.zip) +[hub_1.0.7.zip](https://cf.lanternpowermonitor.com/hub_1.0.7.zip)

Flash this to any micro sd card (4gig or larger) and you're good to go. Fire up the hub and the phone app should be able to connect to it via bluetooth to finish the configuration. The default password on this image is pi/LanternPowerMonitor

When you add the hub to your configuration via the app, you can change where the hub posts data. If you use lanternsoftware.com (the default host), your data will be stored there securely and won't be shared with or sold to anyone. If you really want to run your own server, you're of course welcome to do that instead, instructions are located further down. diff --git a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorApp.java b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorApp.java index 263dcd8..ee63210 100644 --- a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorApp.java +++ b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorApp.java @@ -17,7 +17,6 @@ import com.lanternsoftware.datamodel.currentmonitor.HubConfigService; import com.lanternsoftware.datamodel.currentmonitor.HubPowerMinute; import com.lanternsoftware.datamodel.currentmonitor.NetworkStatus; import com.lanternsoftware.util.CollectionUtils; -import com.lanternsoftware.util.DateUtils; import com.lanternsoftware.util.NullUtils; import com.lanternsoftware.util.ResourceLoader; import com.lanternsoftware.util.ZipUtils; @@ -63,7 +62,6 @@ public class MonitorApp { private static MonitorConfig config; private static BreakerConfig breakerConfig; private static String host; - private static Date lastUpdateCheck = new Date(); private static HttpPool pool; private static LEDFlasher flasher = null; private static final AtomicBoolean running = new AtomicBoolean(true); @@ -154,7 +152,7 @@ public class MonitorApp { } break; case Update: - monitor.submit(new UpdateChecker(true)); + monitor.submit(new UpdateChecker()); break; case ReloadConfig: HttpGet get = new HttpGet(host + "config"); @@ -389,10 +387,6 @@ public class MonitorApp { } if (mqttPoster != null) monitor.submit(() -> mqttPoster.postPower(mqttReadings)); - if (DateUtils.diffInSeconds(new Date(), lastUpdateCheck) >= config.getUpdateInterval()) { - lastUpdateCheck = new Date(); - monitor.submit(new UpdateChecker()); - } long now = new Date().getTime(); long duration = (now - firstPost)%1000; if (now - lastPost < 1000) { @@ -453,19 +447,9 @@ public class MonitorApp { } private static final class UpdateChecker implements Runnable { - private final boolean force; - - public UpdateChecker() { - force = false; - } - - public UpdateChecker(boolean _force) { - force = _force; - } - @Override public void run() { - if (NullUtils.isNotEmpty(host) && (force || config.isAutoUpdate())) { + if (NullUtils.isNotEmpty(host)) { DaoEntity meta = DaoSerializer.fromZipBson(pool.executeToByteArray(new HttpGet(host + "update/version"))); String newVersion = DaoSerializer.getString(meta, "version"); if (NullUtils.isNotEqual(newVersion, version)) { diff --git a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorConfig.java b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorConfig.java index 07a2fd0..f2727da 100644 --- a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorConfig.java +++ b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/MonitorConfig.java @@ -16,9 +16,6 @@ public class MonitorConfig { private boolean debug; private int connectTimeout; private int socketTimeout; - private int updateInterval; - private boolean autoUpdate; - private float autoCalibrationVoltage; private boolean needsCalibration; private String mqttBrokerUrl; private String mqttUserName; @@ -100,30 +97,6 @@ public class MonitorConfig { socketTimeout = _socketTimeout; } - public int getUpdateInterval() { - return updateInterval == 0 ? 300 : updateInterval; - } - - public void setUpdateInterval(int _updateInterval) { - updateInterval = _updateInterval; - } - - public boolean isAutoUpdate() { - return autoUpdate; - } - - public void setAutoUpdate(boolean _autoUpdate) { - autoUpdate = _autoUpdate; - } - - public float getAutoCalibrationVoltage() { - return autoCalibrationVoltage; - } - - public void setAutoCalibrationVoltage(float _autoCalibrationVoltage) { - autoCalibrationVoltage = _autoCalibrationVoltage; - } - public boolean isNeedsCalibration() { return needsCalibration; } diff --git a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/dao/MonitorConfigSerializer.java b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/dao/MonitorConfigSerializer.java index f9d4e63..ad54fda 100644 --- a/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/dao/MonitorConfigSerializer.java +++ b/currentmonitor/lantern-currentmonitor/src/main/java/com/lanternsoftware/currentmonitor/dao/MonitorConfigSerializer.java @@ -34,9 +34,6 @@ public class MonitorConfigSerializer extends AbstractDaoSerializer