From e53d770b3d6e20e87602f2d5fdcdd74179550884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Wed, 5 Aug 2020 00:31:12 +0200 Subject: [PATCH] Update pymetno lib, and start using met api v2 (#38547) --- homeassistant/components/met/manifest.json | 2 +- homeassistant/components/met/weather.py | 12 +++++------- homeassistant/components/norway_air/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/met/manifest.json b/homeassistant/components/met/manifest.json index f4f32a5097f..a68a8223ba5 100644 --- a/homeassistant/components/met/manifest.json +++ b/homeassistant/components/met/manifest.json @@ -3,6 +3,6 @@ "name": "Meteorologisk institutt (Met.no)", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/met", - "requirements": ["pyMetno==0.5.1"], + "requirements": ["pyMetno==0.7.0"], "codeowners": ["@danielhiversen"] } diff --git a/homeassistant/components/met/weather.py b/homeassistant/components/met/weather.py index 7f71fbe07eb..a1bcc360623 100644 --- a/homeassistant/components/met/weather.py +++ b/homeassistant/components/met/weather.py @@ -36,7 +36,7 @@ ATTRIBUTION = ( ) DEFAULT_NAME = "Met.no" -URL = "https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/" +URL = "https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/2.0/classic" PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( { @@ -105,13 +105,11 @@ class MetWeather(WeatherEntity): elevation = conf[CONF_ELEVATION] if not self._is_metric: - elevation = int( - round(convert_distance(elevation, LENGTH_FEET, LENGTH_METERS)) - ) + elevation = convert_distance(elevation, LENGTH_FEET, LENGTH_METERS) coordinates = { - "lat": str(latitude), - "lon": str(longitude), - "msl": str(elevation), + "lat": latitude, + "lon": longitude, + "msl": elevation, } if coordinates == self._coordinates: return diff --git a/homeassistant/components/norway_air/manifest.json b/homeassistant/components/norway_air/manifest.json index d815482c3f0..2898ee6ff64 100644 --- a/homeassistant/components/norway_air/manifest.json +++ b/homeassistant/components/norway_air/manifest.json @@ -2,6 +2,6 @@ "domain": "norway_air", "name": "Om Luftkvalitet i Norge (Norway Air)", "documentation": "https://www.home-assistant.io/integrations/norway_air", - "requirements": ["pyMetno==0.5.1"], + "requirements": ["pyMetno==0.7.0"], "codeowners": [] } diff --git a/requirements_all.txt b/requirements_all.txt index aecac46f944..ce3b5751074 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1178,7 +1178,7 @@ pyHS100==0.3.5.1 # homeassistant.components.met # homeassistant.components.norway_air -pyMetno==0.5.1 +pyMetno==0.7.0 # homeassistant.components.rfxtrx pyRFXtrx==0.25 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ac5d3ceefdf..feac0608b5e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -556,7 +556,7 @@ pyHS100==0.3.5.1 # homeassistant.components.met # homeassistant.components.norway_air -pyMetno==0.5.1 +pyMetno==0.7.0 # homeassistant.components.rfxtrx pyRFXtrx==0.25