Lukas Cerny vor 6 Jahren
Ursprung
Commit
ce5a1b5217

+ 3 - 3
config/fieldclimateSenslog1.yaml

@@ -3,13 +3,13 @@ settings:
       name: "Senslog V1"
       provider: "cz.senslog.connector.push.rest.senslog.v1.SenslogV1ConnectorPushProvider"
       host:
-        domain: "http://localhost:9080"
-        path: "/FeederServlet"
+        domain: "http://51.15.45.95:8080/senslog1"
+        path: "FeederServlet"
 
   - Fieldclimate:
       name: "FieldClimate: Pessl Instruments"
       provider: "cz.senslog.connector.fetch.fieldclimate.ConnectorFetchFieldClimateProvider"
-      startDate: 2019-03-07T00:00:00.000
+      startDate: 2019-03-08T00:00:00.000
 
       <<: &apiDomain
         domain: "https://api.fieldclimate.com/v1"

+ 6 - 3
config/lorawanSenslog1.yaml

@@ -5,18 +5,21 @@ settings:
         startDate: 2019-09-30T10:00:00.000
 #        endDate: 2019-09-30T11:00:00.000
         limitPerSensor: 100
+
+        <<: &apiDomain
+            domain: "https://iotlorawan.azurewebsites.net"
         
         sensorInfoHost:
-            domain: "https://iotlorawan.azurewebsites.net"
+            <<: *apiDomain
             path: "api/sensors"
         
         sensorDataHost:
-            domain: "https://iotlorawan.azurewebsites.net"
+            <<: *apiDomain
             path: "api/sensordata"
         
         authentication:
             host:
-                domain: "https://iotlorawan.azurewebsites.net"
+                <<: *apiDomain
                 path: "api/accounts/login"
             username: "netluky@ima.cz"
             password: "SensLogIMA1"

+ 1 - 0
connector-common/src/main/java/cz/senslog/connector/http/HttpClient.java

@@ -189,6 +189,7 @@ public class HttpClient {
      * @throws IOException can not get body from the response.
      */
     private String getBody(HttpEntity entity) throws IOException {
+        if (entity == null) return "";
         InputStream contentStream = entity.getContent();
         InputStreamReader bodyStream = new InputStreamReader(contentStream);
         BufferedReader rd = new BufferedReader(bodyStream);

+ 1 - 1
connector-fetch-fieldclimate/src/main/java/cz/senslog/connector/fetch/fieldclimate/FieldClimateFetcher.java

@@ -121,7 +121,7 @@ public class FieldClimateFetcher implements ConnectorFetcher<FieldClimateModel>
 
             logger.debug("Getting a start date time for station {}.", stationId);
             LocalDateTime localFrom = stationTimeRanges.get(stationId);
-            LocalDateTime localTo = localFrom.plusHours(5); // default interval (5h around 600 observations)
+            LocalDateTime localTo = localFrom.plusDays(1); // default interval (5h around 600 observations)
 
             StationTimeRange timeRange = getTimeRangeForStation(stationId);
             if (timeRange == null) break;

+ 7 - 5
connector-fetch-fieldclimate/src/test/java/cz/senslog/connector/fetch/fieldclimate/FieldClimateFetcherTest.java

@@ -35,7 +35,7 @@ class FieldClimateFetcherTest {
 
     private static FieldClimateConfig config;
     private static AuthenticationService authService;
-    private static LocalDateTime startDate = LocalDateTime.of(2019, 9, 22, 0, 0,0);
+    private static LocalDateTime startDate = LocalDateTime.of(2019, 10, 1, 0, 0,0);
 
     @BeforeAll
     static void init() {
@@ -372,7 +372,7 @@ class FieldClimateFetcherTest {
 
 
 
-/*
+    /*
     @Test
     void fetch() throws Exception {
 
@@ -380,11 +380,13 @@ class FieldClimateFetcherTest {
 
         fetcher.init();
 
-        fetcher.fetch();
-        fetcher.fetch();
+//        fetcher.fetch();
+//        fetcher.fetch();
 
+        SenslogV1Model model = new FieldClimateModelSenslogV1ModelConverter().convert(fetcher.fetch());
+        Observation obs = (Observation)model.getObservations().get(0);
 
-        System.out.println(new FieldClimateModelSenslogV1ModelConverter().convert(fetcher.fetch()).getObservations());
+        System.out.println(obs);
     }
 */
     /*