Moved find device to its own utility method, and added a specific equals method and reworked some test.
This commit is contained in:
parent
7e8938c38c
commit
c7e286f51e
166 changed files with 618 additions and 374 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package se.hal.plugin.raspberry;
|
||||
|
||||
import se.hal.intf.HalDeviceConfig;
|
||||
import se.hal.intf.HalSensorConfig;
|
||||
import se.hal.intf.HalSensorController;
|
||||
import se.hal.intf.HalSensorData;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package se.hal.plugin.raspberry;
|
||||
|
||||
import se.hal.intf.HalDeviceConfig;
|
||||
import se.hal.intf.HalSensorConfig;
|
||||
import se.hal.intf.HalSensorController;
|
||||
import se.hal.intf.HalSensorData;
|
||||
|
|
@ -12,13 +13,17 @@ public class RPiTemperatureSensor implements HalSensorConfig {
|
|||
private String w1Address;
|
||||
|
||||
|
||||
|
||||
public RPiTemperatureSensor() { }
|
||||
public RPiTemperatureSensor(String w1Address) {
|
||||
this.w1Address = w1Address;
|
||||
}
|
||||
|
||||
|
||||
public String get1WAddress() {
|
||||
return w1Address;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getDataInterval() {
|
||||
return 10*60*1000; // 10 min
|
||||
|
|
@ -45,9 +50,4 @@ public class RPiTemperatureSensor implements HalSensorConfig {
|
|||
return this.get1WAddress().equals(((RPiTemperatureSensor) obj).w1Address);
|
||||
return false;
|
||||
}
|
||||
|
||||
public String get1WAddress() {
|
||||
return w1Address;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue