mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Override api url in norway_air (#59573)
This commit is contained in:
parent
e30e4d5c6d
commit
363de37400
@ -3,7 +3,7 @@
|
|||||||
"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.8.3"],
|
"requirements": ["pyMetno==0.8.4"],
|
||||||
"codeowners": ["@danielhiversen", "@thimic"],
|
"codeowners": ["@danielhiversen", "@thimic"],
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@ CONF_FORECAST = "forecast"
|
|||||||
DEFAULT_FORECAST = 0
|
DEFAULT_FORECAST = 0
|
||||||
DEFAULT_NAME = "Air quality Norway"
|
DEFAULT_NAME = "Air quality Norway"
|
||||||
|
|
||||||
|
OVERRIDE_URL = "https://aa015h6buqvih86i1.api.met.no/weatherapi/airqualityforecast/0.1/"
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
vol.Optional(CONF_FORECAST, default=DEFAULT_FORECAST): vol.Coerce(int),
|
vol.Optional(CONF_FORECAST, default=DEFAULT_FORECAST): vol.Coerce(int),
|
||||||
@ -72,7 +74,9 @@ class AirSensor(AirQualityEntity):
|
|||||||
def __init__(self, name, coordinates, forecast, session):
|
def __init__(self, name, coordinates, forecast, session):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self._name = name
|
self._name = name
|
||||||
self._api = metno.AirQualityData(coordinates, forecast, session)
|
self._api = metno.AirQualityData(
|
||||||
|
coordinates, forecast, session, api_url=OVERRIDE_URL
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def attribution(self) -> str:
|
def attribution(self) -> str:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"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.8.3"],
|
"requirements": ["pyMetno==0.8.4"],
|
||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
}
|
}
|
||||||
|
@ -1315,7 +1315,7 @@ pyMetEireann==2021.8.0
|
|||||||
|
|
||||||
# homeassistant.components.met
|
# homeassistant.components.met
|
||||||
# homeassistant.components.norway_air
|
# homeassistant.components.norway_air
|
||||||
pyMetno==0.8.3
|
pyMetno==0.8.4
|
||||||
|
|
||||||
# homeassistant.components.rfxtrx
|
# homeassistant.components.rfxtrx
|
||||||
pyRFXtrx==0.27.0
|
pyRFXtrx==0.27.0
|
||||||
|
@ -790,7 +790,7 @@ pyMetEireann==2021.8.0
|
|||||||
|
|
||||||
# homeassistant.components.met
|
# homeassistant.components.met
|
||||||
# homeassistant.components.norway_air
|
# homeassistant.components.norway_air
|
||||||
pyMetno==0.8.3
|
pyMetno==0.8.4
|
||||||
|
|
||||||
# homeassistant.components.rfxtrx
|
# homeassistant.components.rfxtrx
|
||||||
pyRFXtrx==0.27.0
|
pyRFXtrx==0.27.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user