Refactor classes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package manage.FITBITData;
|
||||
package device.FITBITData;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage.FITBITData;
|
||||
package device.FITBITData;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage.FITBITData;
|
||||
package device.FITBITData;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage.FITBITData;
|
||||
package device.FITBITData;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -1,11 +1,14 @@
|
||||
package manage.FITBITData;
|
||||
package device;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import manage.AuthFITBIT;
|
||||
import device.FITBITData.HeartRate;
|
||||
import device.FITBITData.Sleep;
|
||||
import device.FITBITData.Steps;
|
||||
import oauth.AuthFITBIT;
|
||||
|
||||
public class FitBit {
|
||||
|
||||
@@ -3,7 +3,7 @@ package device;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import manage.Rest;
|
||||
import support.Rest;
|
||||
|
||||
public class Hue {
|
||||
//private String baseURL = "192.168.0.2";
|
||||
|
||||
@@ -4,6 +4,8 @@ import de.fh_zwickau.informatik.sensor.IZWayApi;
|
||||
import de.fh_zwickau.informatik.sensor.ZWayApiHttp;
|
||||
import de.fh_zwickau.informatik.sensor.model.devices.Device;
|
||||
import de.fh_zwickau.informatik.sensor.model.devices.DeviceList;
|
||||
import support.ZWaySimpleCallback;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -21,15 +23,12 @@ public class Sensor {
|
||||
public IZWayApi zwayApi;
|
||||
private DeviceList allZWaveDevices;
|
||||
private DeviceList devices;
|
||||
private Integer nodeId;
|
||||
|
||||
public Sensor() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public Sensor (Integer nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
|
||||
// create an instance of the Z-Way library; all the params are mandatory (we are not going to use the remote service/id)
|
||||
zwayApi = new ZWayApiHttp(ipAddress, 8083, "http", username, password, 0, false, new ZWaySimpleCallback());
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage;
|
||||
package oauth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage;
|
||||
package oauth;
|
||||
|
||||
import com.google.api.client.http.GenericUrl;
|
||||
import com.google.api.client.util.Key;
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage;
|
||||
package oauth;
|
||||
|
||||
public class OAuth2ClientCredentials {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package manage;
|
||||
package support;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@@ -1,4 +1,4 @@
|
||||
package device;
|
||||
package support;
|
||||
|
||||
import de.fh_zwickau.informatik.sensor.IZWayApiCallbacks;
|
||||
import de.fh_zwickau.informatik.sensor.model.devicehistory.DeviceHistory;
|
||||
@@ -17,6 +17,8 @@ import de.fh_zwickau.informatik.sensor.model.profiles.Profile;
|
||||
import de.fh_zwickau.informatik.sensor.model.profiles.ProfileList;
|
||||
import de.fh_zwickau.informatik.sensor.model.zwaveapi.controller.ZWaveController;
|
||||
import de.fh_zwickau.informatik.sensor.model.zwaveapi.devices.ZWaveDevice;
|
||||
import device.Sensor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import manage.FITBITData.FitBit;
|
||||
import org.junit.Test;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) throws Exception {
|
||||
import device.FitBit;
|
||||
|
||||
public class TestFitbit {
|
||||
|
||||
@Test
|
||||
public void test01() throws Exception {
|
||||
FitBit fitBit = new FitBit();
|
||||
fitBit.getHoursSleep();
|
||||
|
||||
Reference in New Issue
Block a user