From 572fd3ddeda61484f1367bce905fb6c18faf37ce Mon Sep 17 00:00:00 2001 From: Sami Salonen Date: Sat, 29 May 2021 15:23:23 +0300 Subject: [PATCH] =?UTF-8?q?[fmiweather]=C2=A0Fixed=20to=20work=20with=20ne?= =?UTF-8?q?w=20API=20(#10765)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests updated as well Signed-off-by: Sami Salonen --- .../fmiweather/internal/client/Client.java | 5 +- .../AbstractFMIResponseParsingTest.java | 33 +- ...FMIResponseParsingExceptionReportTest.java | 2 +- .../FMIResponseParsingMultiplePlacesTest.java | 19 +- .../fmiweather/ParsingStationsTest.java | 4 +- .../org/openhab/binding/fmiweather/error1.xml | 17 +- .../fmiweather/forecast_multiple_places.xml | 350 +++++++------- .../binding/fmiweather/observations_empty.xml | 37 +- .../observations_multiple_places.xml | 430 +++++++++--------- .../fmiweather/observations_single_place.xml | 256 ++++++----- .../openhab/binding/fmiweather/stations.xml | 267 ++++++----- 11 files changed, 724 insertions(+), 696 deletions(-) diff --git a/bundles/org.openhab.binding.fmiweather/src/main/java/org/openhab/binding/fmiweather/internal/client/Client.java b/bundles/org.openhab.binding.fmiweather/src/main/java/org/openhab/binding/fmiweather/internal/client/Client.java index 2e4e5a016b1d1..4c3e9cd2b26e0 100644 --- a/bundles/org.openhab.binding.fmiweather/src/main/java/org/openhab/binding/fmiweather/internal/client/Client.java +++ b/bundles/org.openhab.binding.fmiweather/src/main/java/org/openhab/binding/fmiweather/internal/client/Client.java @@ -71,7 +71,7 @@ public class Client { private static final Map NAMESPACES = new HashMap<>(); static { - NAMESPACES.put("target", "http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.0"); + NAMESPACES.put("target", "http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.1"); NAMESPACES.put("gml", "http://www.opengis.net/gml/3.2"); NAMESPACES.put("xlink", "http://www.w3.org/1999/xlink"); NAMESPACES.put("ows", "http://www.opengis.net/ows/1.1"); @@ -374,7 +374,8 @@ private String[] queryNodeValues(XPathExpression expression, Object source) thro */ private String takeFirstOrError(String errorDescription, String[] values) throws FMIUnexpectedResponseException { if (values.length != 1) { - throw new FMIUnexpectedResponseException(String.format("No unique match found: %s", errorDescription)); + throw new FMIUnexpectedResponseException( + String.format("No unique match found: %s (found %d)", errorDescription, values.length)); } return values[0]; } diff --git a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/AbstractFMIResponseParsingTest.java b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/AbstractFMIResponseParsingTest.java index 397e46832ffc1..ef6b89fe623a0 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/AbstractFMIResponseParsingTest.java +++ b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/AbstractFMIResponseParsingTest.java @@ -12,7 +12,7 @@ */ package org.openhab.binding.fmiweather; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.fail; import java.io.BufferedReader; import java.io.IOException; @@ -23,6 +23,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.HashSet; import java.util.Objects; import java.util.Set; @@ -109,6 +110,36 @@ protected boolean matchesSafely(Data dataValues) { return timestampMatcher.matches(dataValues.timestampsEpochSecs) && valuesMatcher.matches(dataValues.values); } + + @Override + protected void describeMismatchSafely(Data dataValues, @Nullable Description mismatchDescription) { + if (mismatchDescription == null) { + super.describeMismatchSafely(dataValues, mismatchDescription); + return; + } + if (!timestampMatcher.matches(dataValues.timestampsEpochSecs)) { + mismatchDescription.appendText("timestamps mismatch: "); + if (dataValues.timestampsEpochSecs[0] != start) { + mismatchDescription.appendText("start mismatch (was "); + mismatchDescription.appendValue(dataValues.timestampsEpochSecs[0]); + mismatchDescription.appendText(")"); + } else if (dataValues.timestampsEpochSecs.length != values.length) { + mismatchDescription.appendText("length mismatch (was "); + mismatchDescription.appendValue(dataValues.timestampsEpochSecs.length); + mismatchDescription.appendText(")"); + } else { + mismatchDescription.appendText("interval mismatch (was "); + Set intervals = new HashSet<>(); + for (int i = 1; i < values.length; i++) { + long interval = dataValues.timestampsEpochSecs[i] - dataValues.timestampsEpochSecs[i - 1]; + intervals.add(interval); + } + mismatchDescription.appendValue(intervals.toArray()); + mismatchDescription.appendText(")"); + } + } + mismatchDescription.appendText(", valuesMatch=").appendValue(valuesMatcher.matches(dataValues.values)); + } }; } diff --git a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingExceptionReportTest.java b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingExceptionReportTest.java index afa615c270176..d82da881f981d 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingExceptionReportTest.java +++ b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingExceptionReportTest.java @@ -39,7 +39,7 @@ public void testErrorResponse() { } catch (FMIResponseException e) { // OK assertThat(e.getMessage(), is( - "Exception report (OperationParsingFailed): [Invalid time interval!, The start time is later than the end time., URI:\n\t\t\t/wfs?endtime=1900-03-10T20%3A10%3A00Z&fmisid=101023¶meters=t2m%2Crh%2Cwd_10min%2Cws_10min%2Cwg_10min%2Cp_sea&request=getFeature&service=WFS&starttime=2019-03-10T10%3A10%3A00Z&storedquery_id=fmi%3A%3Aobservations%3A%3Aweather%3A%3Amultipointcoverage×tep=60&version=2.0.0]")); + "Exception report (OperationParsingFailed): [Invalid time interval!, The start time is later than the end time., URI: /wfs?endtime=1900-03-10T20%3A10%3A00Z&fmisid=101023¶meters=t2m%2Crh%2Cwd_10min%2Cws_10min%2Cwg_10min%2Cp_sea&request=getFeature&service=WFS&starttime=2019-03-10T10%3A10%3A00Z&storedquery_id=fmi%3A%3Aobservations%3A%3Aweather%3A%3Amultipointcoverage×tep=60&version=2.0.0]")); return; } catch (Throwable e) { fail("Wrong exception, was " + e.getClass().getName()); diff --git a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingMultiplePlacesTest.java b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingMultiplePlacesTest.java index 938a728178157..5c4d4efd9d3ef 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingMultiplePlacesTest.java +++ b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/FMIResponseParsingMultiplePlacesTest.java @@ -73,7 +73,6 @@ public void setUp() { } } - @SuppressWarnings("unchecked") @Test public void testLocationsMultiplePlacesObservations() { // locations @@ -82,7 +81,6 @@ public void testLocationsMultiplePlacesObservations() { hasItems(deeplyEqualTo(emasalo), deeplyEqualTo(kilpilahti), deeplyEqualTo(harabacka))); } - @SuppressWarnings("unchecked") @Test public void testLocationsMultiplePlacesForecasts() { // locations @@ -123,19 +121,20 @@ public void testParseObservationsMultipleData() { @Test public void testParseForecastsMultipleData() { + long start = 1622116800; Data temperature = forecastsMultiplePlacesResponse.getData(maarianhamina, "Temperature").get(); - assertThat(temperature, is(deeplyEqualTo(1553688000, 360, "3.84", "2.62", "2.26", "1.22", "5.47", "5.52", - "5.42", "4.78", "8.34", "7.15", null, null, null, null))); + assertThat(temperature, is(deeplyEqualTo(start, 360, "7.75", "7.94", "6.72", "8.22", "11.37", "9.69", "6.42", + "9.52", "11.04", "9.69", null, null, null, null))); Data temperature2 = forecastsMultiplePlacesResponse.getData(pointWithNoName, "Temperature").get(); - assertThat(temperature2, is(deeplyEqualTo(1553688000, 360, "1.54", "2.91", "2.41", "2.36", "4.22", "5.28", - "4.58", "4.0", "4.79", "5.4", null, null, null, null))); + assertThat(temperature2, is(deeplyEqualTo(start, 360, "7.46", "6.56", "6.2", "5.15", "5.05", "5.96", "6.2", + "5.94", "5.69", "5.47", null, null, null, null))); Data humidity = forecastsMultiplePlacesResponse.getData(maarianhamina, "Humidity").get(); - assertThat(humidity, is(deeplyEqualTo(1553688000, 360, "66.57", "87.38", "85.77", "96.3", "75.74", "81.7", - "86.78", "87.96", "70.86", "76.35", null, null, null, null))); + assertThat(humidity, is(deeplyEqualTo(start, 360, "93.76", "93.24", "98.22", "93.93", "75.78", "58.91", "80.42", + "54.11", "40.29", "46.42", null, null, null, null))); Data humidity2 = forecastsMultiplePlacesResponse.getData(pointWithNoName, "Humidity").get(); - assertThat(humidity2, is(deeplyEqualTo(1553688000, 360, "90.18", "86.22", "89.18", "89.43", "77.26", "78.55", - "83.36", "85.83", "80.82", "76.92", null, null, null, null))); + assertThat(humidity2, is(deeplyEqualTo(start, 360, "93.44", "95.3", "96.15", "93.77", "93.0", "82.1", "81.95", + "81.37", "85.41", "87.8", null, null, null, null))); } @Test diff --git a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/ParsingStationsTest.java b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/ParsingStationsTest.java index b0d3330ca892e..0d9907db3d500 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/ParsingStationsTest.java +++ b/bundles/org.openhab.binding.fmiweather/src/test/java/org/openhab/binding/fmiweather/ParsingStationsTest.java @@ -46,7 +46,7 @@ public void testParseStations() { new BigDecimal("25.549164"))), deeplyEqualTo(new Location("Parainen Utö", "100908", new BigDecimal("59.779094"), new BigDecimal("21.374788"))), - deeplyEqualTo(new Location("Lemland Nyhamn", "100909", new BigDecimal("59.959108"), - new BigDecimal("19.953736"))))); + deeplyEqualTo(new Location("Lemland Nyhamn", "100909", new BigDecimal("59.959194"), + new BigDecimal("19.953667"))))); } } diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/error1.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/error1.xml index c3eafbe525ce4..c679f35206d06 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/error1.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/error1.xml @@ -1,17 +1,16 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" + version="2.0.0" xml:lang="eng"> - - Invalid time interval! - The start time is later than the end time. - URI: - /wfs?endtime=1900-03-10T20%3A10%3A00Z&fmisid=101023&parameters=t2m%2Crh%2Cwd_10min%2Cws_10min%2Cwg_10min%2Cp_sea&request=getFeature&service=WFS&starttime=2019-03-10T10%3A10%3A00Z&storedquery_id=fmi%3A%3Aobservations%3A%3Aweather%3A%3Amultipointcoverage&timestep=60&version=2.0.0 + + Invalid time interval! + The start time is later than the end time. + URI: /wfs?endtime=1900-03-10T20%3A10%3A00Z&fmisid=101023&parameters=t2m%2Crh%2Cwd_10min%2Cws_10min%2Cwg_10min%2Cp_sea&request=getFeature&service=WFS&starttime=2019-03-10T10%3A10%3A00Z&storedquery_id=fmi%3A%3Aobservations%3A%3Aweather%3A%3Amultipointcoverage&timestep=60&version=2.0.0 - + diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/forecast_multiple_places.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/forecast_multiple_places.xml index 5bcec61e92011..ea1957f5933f1 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/forecast_multiple_places.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/forecast_multiple_places.xml @@ -1,185 +1,187 @@ - - + http://inspire.ec.europa.eu/schemas/omso/3.0 https://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd + http://inspire.ec.europa.eu/schemas/ompr/3.0 https://inspire.ec.europa.eu/schemas/ompr/3.0/Processes.xsd + http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.1 http://xml.fmi.fi/schema/om/atmosphericfeatures/1.1/atmosphericfeatures.xsd"> - - - - - 2019-03-27T12:00:00Z - 2019-03-30T18:00:00Z - - - - - 2019-03-27T15:19:43Z - - + + + + + 2021-05-27T12:00:00Z + 2021-05-30T18:00:00Z + + + + + 2021-05-27T15:06:06Z + + - - - - - - - 2019-03-27T12:00:00Z - - - - - - - - - - - - 3041732 - Mariehamn - 3041732 - - Finland - Europe/Mariehamn - Maarianhamina - - - - - NaN - 19.9,61.0973 - NaN - - - Europe/Helsinki + + + + + + + 2021-05-27T12:00:00Z + + + + + + + + + + + + 3041732 + Mariehamn + 3041732 + + Finland + Europe/Mariehamn + Maarianhamina + + + + NaN + 19.9,61.0973 + NaN + + + Europe/Helsinki - - - - - - - - - Mariehamn - 60.09726 19.93481 - - - 19.9,61.0973 - 61.09726 19.90000 - - - - - - - - - - - - 60.09726 19.93481 1553688000 - 60.09726 19.93481 1553709600 - 60.09726 19.93481 1553731200 - 60.09726 19.93481 1553752800 - 60.09726 19.93481 1553774400 - 60.09726 19.93481 1553796000 - 60.09726 19.93481 1553817600 - 60.09726 19.93481 1553839200 - 60.09726 19.93481 1553860800 - 60.09726 19.93481 1553882400 - 60.09726 19.93481 1553904000 - 60.09726 19.93481 1553925600 - 60.09726 19.93481 1553947200 - 60.09726 19.93481 1553968800 - 61.09726 19.90000 1553688000 - 61.09726 19.90000 1553709600 - 61.09726 19.90000 1553731200 - 61.09726 19.90000 1553752800 - 61.09726 19.90000 1553774400 - 61.09726 19.90000 1553796000 - 61.09726 19.90000 1553817600 - 61.09726 19.90000 1553839200 - 61.09726 19.90000 1553860800 - 61.09726 19.90000 1553882400 - 61.09726 19.90000 1553904000 - 61.09726 19.90000 1553925600 - 61.09726 19.90000 1553947200 - 61.09726 19.90000 1553968800 - - - - - - - - 3.84 66.57 - 2.62 87.38 - 2.26 85.77 - 1.22 96.3 - 5.47 75.74 - 5.52 81.7 - 5.42 86.78 - 4.78 87.96 - 8.34 70.86 - 7.15 76.35 - NaN NaN - NaN NaN - NaN NaN - NaN NaN - 1.54 90.18 - 2.91 86.22 - 2.41 89.18 - 2.36 89.43 - 4.22 77.26 - 5.28 78.55 - 4.58 83.36 - 4.0 85.83 - 4.79 80.82 - 5.4 76.92 - NaN NaN - NaN NaN - NaN NaN - NaN NaN - - - - - - Linear - - - - - - - - - - + + + + + + + + Mariehamn + 60.09726 19.93481 + + + 19.9,61.0973 + 61.09726 19.90000 + + + + + + + + + + + + 60.09726 19.93481 1622116800 + 60.09726 19.93481 1622138400 + 60.09726 19.93481 1622160000 + 60.09726 19.93481 1622181600 + 60.09726 19.93481 1622203200 + 60.09726 19.93481 1622224800 + 60.09726 19.93481 1622246400 + 60.09726 19.93481 1622268000 + 60.09726 19.93481 1622289600 + 60.09726 19.93481 1622311200 + 60.09726 19.93481 1622332800 + 60.09726 19.93481 1622354400 + 60.09726 19.93481 1622376000 + 60.09726 19.93481 1622397600 + 61.09726 19.90000 1622116800 + 61.09726 19.90000 1622138400 + 61.09726 19.90000 1622160000 + 61.09726 19.90000 1622181600 + 61.09726 19.90000 1622203200 + 61.09726 19.90000 1622224800 + 61.09726 19.90000 1622246400 + 61.09726 19.90000 1622268000 + 61.09726 19.90000 1622289600 + 61.09726 19.90000 1622311200 + 61.09726 19.90000 1622332800 + 61.09726 19.90000 1622354400 + 61.09726 19.90000 1622376000 + 61.09726 19.90000 1622397600 + + + + + + + + 7.75 93.76 + 7.94 93.24 + 6.72 98.22 + 8.22 93.93 + 11.37 75.78 + 9.69 58.91 + 6.42 80.42 + 9.52 54.11 + 11.04 40.29 + 9.69 46.42 + NaN NaN + NaN NaN + NaN NaN + NaN NaN + 7.46 93.44 + 6.56 95.3 + 6.2 96.15 + 5.15 93.77 + 5.05 93.0 + 5.96 82.1 + 6.2 81.95 + 5.94 81.37 + 5.69 85.41 + 5.47 87.8 + NaN NaN + NaN NaN + NaN NaN + NaN NaN + + + + + + Linear + + + + + + + + + + - - + + diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_empty.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_empty.xml index 04753086c1012..ffcc4329e5d12 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_empty.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_empty.xml @@ -1,22 +1,31 @@ - + http://inspire.ec.europa.eu/schemas/ompr/3.0 https://inspire.ec.europa.eu/schemas/ompr/3.0/Processes.xsd + http://inspire.ec.europa.eu/schemas/omso/3.0 https://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd + http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.1 http://xml.fmi.fi/schema/om/atmosphericfeatures/1.1/atmosphericfeatures.xsd"> - + \ No newline at end of file diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_multiple_places.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_multiple_places.xml index ef343102db084..457481571549d 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_multiple_places.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_multiple_places.xml @@ -1,225 +1,221 @@ - - - - - - - - 2019-03-10T10:10:00Z - 2019-03-10T20:10:00Z - - - - - 2019-03-10T20:10:00Z - - - - - - - - - atmosphere - - - - - - - - - - - - - 100683 - Porvoo Kilpilahti satama - -16777356 - 2994 - - - - Porvoo - - - - - - 101023 - Porvoo Emäsalo - -16000110 - 2991 - - - - Porvoo - - - - - - 101028 - Porvoo Harabacka - -16000142 - 2759 - - - - Porvoo - - - - - - - - - - Porvoo Kilpilahti satama - 60.30373 25.54916 - - - - - Porvoo Emäsalo - 60.20382 25.62546 - - - - - Porvoo Harabacka - 60.39172 25.60730 - - - - - - - - - - - - - 60.30373 25.54916 1552215600 - 60.30373 25.54916 1552219200 - 60.30373 25.54916 1552222800 - 60.30373 25.54916 1552226400 - 60.30373 25.54916 1552230000 - 60.30373 25.54916 1552233600 - 60.30373 25.54916 1552237200 - 60.30373 25.54916 1552240800 - 60.30373 25.54916 1552244400 - 60.30373 25.54916 1552248000 - 60.20382 25.62546 1552215600 - 60.20382 25.62546 1552219200 - 60.20382 25.62546 1552222800 - 60.20382 25.62546 1552226400 - 60.20382 25.62546 1552230000 - 60.20382 25.62546 1552233600 - 60.20382 25.62546 1552237200 - 60.20382 25.62546 1552240800 - 60.20382 25.62546 1552244400 - 60.20382 25.62546 1552248000 - 60.39172 25.60730 1552215600 - 60.39172 25.60730 1552219200 - 60.39172 25.60730 1552222800 - 60.39172 25.60730 1552226400 - 60.39172 25.60730 1552230000 - 60.39172 25.60730 1552233600 - 60.39172 25.60730 1552237200 - 60.39172 25.60730 1552240800 - 60.39172 25.60730 1552244400 - 60.39172 25.60730 1552248000 - - - - - - - - -0.5 73.0 299.0 5.3 8.2 NaN - -0.6 65.0 293.0 7.0 9.1 NaN - -0.9 60.0 300.0 6.2 9.8 NaN - -1.2 59.0 288.0 6.3 8.9 NaN - -1.2 57.0 256.0 4.6 7.1 NaN - -1.6 64.0 232.0 2.4 5.2 NaN - -1.9 66.0 239.0 1.9 3.2 NaN - -2.3 65.0 249.0 3.1 5.0 NaN - -2.9 71.0 280.0 4.3 5.7 NaN - -3.3 77.0 246.0 3.4 5.6 NaN - -0.4 77.0 312.0 8.0 10.0 985.9 - 0.0 70.0 286.0 7.5 9.0 986.5 - 0.1 61.0 295.0 8.6 10.5 987.0 - -1.0 64.0 282.0 8.4 10.5 987.6 - -1.2 65.0 271.0 6.6 8.7 988.1 - -1.3 61.0 262.0 5.0 6.7 988.2 - -1.2 65.0 243.0 8.2 9.6 988.1 - -1.5 69.0 252.0 6.1 7.6 987.9 - -1.7 71.0 262.0 7.3 8.6 988.0 - -2.4 77.0 276.0 6.0 7.5 988.2 - -0.6 74.0 317.0 3.9 7.1 985.9 - -0.9 64.0 290.0 4.2 6.8 986.4 - -1.0 58.0 296.0 5.3 9.1 987.0 - -1.7 66.0 301.0 3.5 6.6 987.6 - -1.9 64.0 269.0 2.6 4.2 988.0 - -2.8 71.0 231.0 1.1 2.3 988.1 - -3.4 78.0 229.0 1.1 1.6 988.1 - -3.8 79.0 229.0 1.8 2.7 987.8 - -4.1 81.0 253.0 2.0 3.2 988.0 - -4.7 86.0 224.0 1.9 3.1 988.2 - - - - - - Linear - - - - - - - - - - - - - - - - - + http://inspire.ec.europa.eu/schemas/ompr/3.0 https://inspire.ec.europa.eu/schemas/ompr/3.0/Processes.xsd + http://inspire.ec.europa.eu/schemas/omso/3.0 https://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd + http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.1 http://xml.fmi.fi/schema/om/atmosphericfeatures/1.1/atmosphericfeatures.xsd"> + + + + + + + 2019-03-10T10:10:00Z + 2019-03-10T20:10:00Z + + + + + 2019-03-10T20:10:00Z + + + + + + + + + atmosphere + + + + + + + + + + + + + 100683 + Porvoo Kilpilahti satama + -16777356 + 2994 + + + + Porvoo + + + + + 101023 + Porvoo Emäsalo + -16000110 + 2991 + + + + Porvoo + + + + + 101028 + Porvoo Harabacka + -16000142 + 2759 + + + + Porvoo + + + + + + + + + Porvoo Kilpilahti satama + 60.30373 25.54916 + + + + + Porvoo Emäsalo + 60.20382 25.62546 + + + + + Porvoo Harabacka + 60.39172 25.60730 + + + + + + + + + + + + + 60.30373 25.54916 1552215600 + 60.30373 25.54916 1552219200 + 60.30373 25.54916 1552222800 + 60.30373 25.54916 1552226400 + 60.30373 25.54916 1552230000 + 60.30373 25.54916 1552233600 + 60.30373 25.54916 1552237200 + 60.30373 25.54916 1552240800 + 60.30373 25.54916 1552244400 + 60.30373 25.54916 1552248000 + 60.20382 25.62546 1552215600 + 60.20382 25.62546 1552219200 + 60.20382 25.62546 1552222800 + 60.20382 25.62546 1552226400 + 60.20382 25.62546 1552230000 + 60.20382 25.62546 1552233600 + 60.20382 25.62546 1552237200 + 60.20382 25.62546 1552240800 + 60.20382 25.62546 1552244400 + 60.20382 25.62546 1552248000 + 60.39172 25.60730 1552215600 + 60.39172 25.60730 1552219200 + 60.39172 25.60730 1552222800 + 60.39172 25.60730 1552226400 + 60.39172 25.60730 1552230000 + 60.39172 25.60730 1552233600 + 60.39172 25.60730 1552237200 + 60.39172 25.60730 1552240800 + 60.39172 25.60730 1552244400 + 60.39172 25.60730 1552248000 + + + + + + + + -0.5 73.0 299.0 5.3 8.2 NaN + -0.6 65.0 293.0 7.0 9.1 NaN + -0.9 60.0 300.0 6.2 9.8 NaN + -1.2 59.0 288.0 6.3 8.9 NaN + -1.2 57.0 256.0 4.6 7.1 NaN + -1.6 64.0 232.0 2.4 5.2 NaN + -1.9 66.0 239.0 1.9 3.2 NaN + -2.3 65.0 249.0 3.1 5.0 NaN + -2.9 71.0 280.0 4.3 5.7 NaN + -3.3 77.0 246.0 3.4 5.6 NaN + -0.4 77.0 312.0 8.0 10.0 985.9 + 0.0 70.0 286.0 7.5 9.0 986.5 + 0.1 61.0 295.0 8.6 10.5 987.0 + -1.0 64.0 282.0 8.4 10.5 987.6 + -1.2 65.0 271.0 6.6 8.7 988.1 + -1.3 61.0 262.0 5.0 6.7 988.2 + -1.2 65.0 243.0 8.2 9.6 988.1 + -1.5 69.0 252.0 6.1 7.6 987.9 + -1.7 71.0 262.0 7.3 8.6 988.0 + -2.4 77.0 276.0 6.0 7.5 988.2 + -0.6 74.0 317.0 3.9 7.1 985.9 + -0.9 64.0 290.0 4.2 6.8 986.4 + -1.0 58.0 296.0 5.3 9.1 987.0 + -1.7 66.0 301.0 3.5 6.6 987.6 + -1.9 64.0 269.0 2.6 4.2 988.0 + -2.8 71.0 231.0 1.1 2.3 988.1 + -3.4 78.0 229.0 1.1 1.6 988.1 + -3.8 79.0 229.0 1.8 2.7 987.8 + -4.1 81.0 253.0 2.0 3.2 988.0 + -4.7 86.0 224.0 1.9 3.1 988.2 + + + + + + Linear + + + + + + + + + + + + + + + + + diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_single_place.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_single_place.xml index 45ad13307f79d..e5cb977423e52 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_single_place.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/observations_single_place.xml @@ -1,146 +1,144 @@ - - + + http://inspire.ec.europa.eu/schemas/ompr/3.0 https://inspire.ec.europa.eu/schemas/ompr/3.0/Processes.xsd + http://inspire.ec.europa.eu/schemas/omso/3.0 https://inspire.ec.europa.eu/schemas/omso/3.0/SpecialisedObservations.xsd + http://xml.fmi.fi/namespace/om/atmosphericfeatures/1.1 http://xml.fmi.fi/schema/om/atmosphericfeatures/1.1/atmosphericfeatures.xsd"> - - + + - - - 2019-03-10T10:10:00Z - 2019-03-10T20:10:00Z - - - - - 2019-03-10T20:10:00Z - - + + + 2019-03-10T10:10:00Z + 2019-03-10T20:10:00Z + + + + + 2019-03-10T20:10:00Z + + - - - - - - atmosphere - - - + + + + + + atmosphere + + + - - - + + + - - - - - 101023 - Porvoo Emäsalo - -16000110 - 2991 - + + + + + 101023 + Porvoo Emäsalo + -16000110 + 2991 + - Porvoo + Porvoo - - - - - - - - - Porvoo Emäsalo - 60.20382 25.62546 - - - - - - + + + + + + + + Porvoo Emäsalo + 60.20382 25.62546 + + + + + + - - - - - - 60.20382 25.62546 1552215600 - 60.20382 25.62546 1552219200 - 60.20382 25.62546 1552222800 - 60.20382 25.62546 1552226400 - 60.20382 25.62546 1552230000 - 60.20382 25.62546 1552233600 - 60.20382 25.62546 1552237200 - 60.20382 25.62546 1552240800 - 60.20382 25.62546 1552244400 - 60.20382 25.62546 1552248000 - - - - - - - - -0.4 77.0 312.0 8.0 10.0 985.9 - 0.0 70.0 286.0 7.5 9.0 986.5 - 0.1 61.0 295.0 8.6 10.5 987.0 - -1.0 64.0 282.0 8.4 10.5 987.6 - -1.2 65.0 271.0 6.6 8.7 988.1 - -1.3 61.0 262.0 5.0 6.7 988.2 - -1.2 65.0 243.0 8.2 9.6 988.1 - -1.5 69.0 252.0 6.1 7.6 987.9 - -1.7 71.0 262.0 7.3 8.6 988.0 - -2.4 77.0 276.0 6.0 7.5 988.2 - - - - - - Linear - - - - - - - - - - - - - - + + + + + + 60.20382 25.62546 1552215600 + 60.20382 25.62546 1552219200 + 60.20382 25.62546 1552222800 + 60.20382 25.62546 1552226400 + 60.20382 25.62546 1552230000 + 60.20382 25.62546 1552233600 + 60.20382 25.62546 1552237200 + 60.20382 25.62546 1552240800 + 60.20382 25.62546 1552244400 + 60.20382 25.62546 1552248000 + + + + + + + + -0.4 77.0 312.0 8.0 10.0 985.9 + 0.0 70.0 286.0 7.5 9.0 986.5 + 0.1 61.0 295.0 8.6 10.5 987.0 + -1.0 64.0 282.0 8.4 10.5 987.6 + -1.2 65.0 271.0 6.6 8.7 988.1 + -1.3 61.0 262.0 5.0 6.7 988.2 + -1.2 65.0 243.0 8.2 9.6 988.1 + -1.5 69.0 252.0 6.1 7.6 987.9 + -1.7 71.0 262.0 7.3 8.6 988.0 + -2.4 77.0 276.0 6.0 7.5 988.2 + + + + + + Linear + + + + + + + + + + + + + + - - + + diff --git a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/stations.xml b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/stations.xml index 0168746f09b69..f73857a69d693 100644 --- a/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/stations.xml +++ b/bundles/org.openhab.binding.fmiweather/src/test/resources/org/openhab/binding/fmiweather/stations.xml @@ -1,140 +1,133 @@ - - - - - 100683 - Porvoo Kilpilahti satama - -16777356 - 02994 - Porvoo - Suomi - - - 100683 - http://xml.fmi.fi/namespace/identifier/station/inspire - - - Porvoo Kilpilahti satama - - - - 60.303725 25.549164 - - - - false - - - - - 2014-06-19T00:00:00Z - - - - - - - - - - - 100908 - Parainen Utö - -16000054 - 02981 - Parainen - Suomi - - - 100908 - http://xml.fmi.fi/namespace/identifier/station/inspire - - - Parainen Utö - - - - 59.779094 21.374788 - - - - false - - - - - 1881-02-01T00:00:00Z - - - - - - - - - - - - - - - 100909 - Lemland Nyhamn - -16000086 - 02980 - Lemland - Suomi - - - 100909 - http://xml.fmi.fi/namespace/identifier/station/inspire - - - Lemland Nyhamn - - - - 59.959108 19.953736 - - - - false - - - - - 1958-10-01T00:00:00Z - - - - - - - - - + + + + + 100683 + Porvoo Kilpilahti satama + -16777356 + 02994 + Porvoo + Suomi + + + 100683 + http://xml.fmi.fi/namespace/identifier/station/inspire + + + Porvoo Kilpilahti satama + + + + 60.303725 25.549164 + + + + false + + + + + 2014-06-19T00:00:00Z + + + + + + + + + + + 100908 + Parainen Utö + -16000054 + 02981 + Parainen + Suomi + + + 100908 + http://xml.fmi.fi/namespace/identifier/station/inspire + + + Parainen Utö + + + + 59.779094 21.374788 + + + + false + + + + + 1881-02-01T00:00:00Z + + + + + + + + + + + + + + + + 100909 + Lemland Nyhamn + -16000086 + 02980 + Lemland + Suomi + + + 100909 + http://xml.fmi.fi/namespace/identifier/station/inspire + + + Lemland Nyhamn + + + + 59.959194 19.953667 + + + + false + + + + + 1958-09-16T00:00:00Z + + + + + + + + + +