Update pymetno lib, and start using met api v2 (#38547)

This commit is contained in:
Daniel Hjelseth Høyer 2020-08-05 00:31:12 +02:00 committed by GitHub
parent 1e32d0e2b9
commit e53d770b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 11 deletions

View File

@ -3,6 +3,6 @@
"name": "Meteorologisk institutt (Met.no)", "name": "Meteorologisk institutt (Met.no)",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/met", "documentation": "https://www.home-assistant.io/integrations/met",
"requirements": ["pyMetno==0.5.1"], "requirements": ["pyMetno==0.7.0"],
"codeowners": ["@danielhiversen"] "codeowners": ["@danielhiversen"]
} }

View File

@ -36,7 +36,7 @@ ATTRIBUTION = (
) )
DEFAULT_NAME = "Met.no" 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( PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
{ {
@ -105,13 +105,11 @@ class MetWeather(WeatherEntity):
elevation = conf[CONF_ELEVATION] elevation = conf[CONF_ELEVATION]
if not self._is_metric: if not self._is_metric:
elevation = int( elevation = convert_distance(elevation, LENGTH_FEET, LENGTH_METERS)
round(convert_distance(elevation, LENGTH_FEET, LENGTH_METERS))
)
coordinates = { coordinates = {
"lat": str(latitude), "lat": latitude,
"lon": str(longitude), "lon": longitude,
"msl": str(elevation), "msl": elevation,
} }
if coordinates == self._coordinates: if coordinates == self._coordinates:
return return

View File

@ -2,6 +2,6 @@
"domain": "norway_air", "domain": "norway_air",
"name": "Om Luftkvalitet i Norge (Norway Air)", "name": "Om Luftkvalitet i Norge (Norway Air)",
"documentation": "https://www.home-assistant.io/integrations/norway_air", "documentation": "https://www.home-assistant.io/integrations/norway_air",
"requirements": ["pyMetno==0.5.1"], "requirements": ["pyMetno==0.7.0"],
"codeowners": [] "codeowners": []
} }

View File

@ -1178,7 +1178,7 @@ pyHS100==0.3.5.1
# homeassistant.components.met # homeassistant.components.met
# homeassistant.components.norway_air # homeassistant.components.norway_air
pyMetno==0.5.1 pyMetno==0.7.0
# homeassistant.components.rfxtrx # homeassistant.components.rfxtrx
pyRFXtrx==0.25 pyRFXtrx==0.25

View File

@ -556,7 +556,7 @@ pyHS100==0.3.5.1
# homeassistant.components.met # homeassistant.components.met
# homeassistant.components.norway_air # homeassistant.components.norway_air
pyMetno==0.5.1 pyMetno==0.7.0
# homeassistant.components.rfxtrx # homeassistant.components.rfxtrx
pyRFXtrx==0.25 pyRFXtrx==0.25