mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +00:00
Upgrades Garages Amsterdam to v3.0.0 (#61734)
This commit is contained in:
parent
0d4051efcb
commit
dea20cf816
@ -3,7 +3,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
import garages_amsterdam
|
from garages_amsterdam import GaragesAmsterdam
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
@ -43,9 +43,9 @@ async def get_coordinator(
|
|||||||
async with async_timeout.timeout(10):
|
async with async_timeout.timeout(10):
|
||||||
return {
|
return {
|
||||||
garage.garage_name: garage
|
garage.garage_name: garage
|
||||||
for garage in await garages_amsterdam.get_garages(
|
for garage in await GaragesAmsterdam(
|
||||||
aiohttp_client.async_get_clientsession(hass)
|
session=aiohttp_client.async_get_clientsession(hass)
|
||||||
)
|
).all_garages()
|
||||||
}
|
}
|
||||||
|
|
||||||
coordinator = DataUpdateCoordinator(
|
coordinator = DataUpdateCoordinator(
|
||||||
|
@ -5,7 +5,7 @@ import logging
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aiohttp import ClientResponseError
|
from aiohttp import ClientResponseError
|
||||||
import garages_amsterdam
|
from garages_amsterdam import GaragesAmsterdam
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
@ -30,9 +30,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
if self._options is None:
|
if self._options is None:
|
||||||
self._options = []
|
self._options = []
|
||||||
try:
|
try:
|
||||||
api_data = await garages_amsterdam.get_garages(
|
api_data = await GaragesAmsterdam(
|
||||||
aiohttp_client.async_get_clientsession(self.hass)
|
session=aiohttp_client.async_get_clientsession(self.hass)
|
||||||
)
|
).all_garages()
|
||||||
except ClientResponseError:
|
except ClientResponseError:
|
||||||
_LOGGER.error("Unexpected response from server")
|
_LOGGER.error("Unexpected response from server")
|
||||||
return self.async_abort(reason="cannot_connect")
|
return self.async_abort(reason="cannot_connect")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Garages Amsterdam",
|
"name": "Garages Amsterdam",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/garages_amsterdam",
|
"documentation": "https://www.home-assistant.io/integrations/garages_amsterdam",
|
||||||
"requirements": ["garages-amsterdam==2.1.1"],
|
"requirements": ["garages-amsterdam==3.0.0"],
|
||||||
"codeowners": ["@klaasnicolaas"],
|
"codeowners": ["@klaasnicolaas"],
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
}
|
}
|
||||||
|
@ -695,7 +695,7 @@ fritzconnection==1.7.2
|
|||||||
gTTS==2.2.3
|
gTTS==2.2.3
|
||||||
|
|
||||||
# homeassistant.components.garages_amsterdam
|
# homeassistant.components.garages_amsterdam
|
||||||
garages-amsterdam==2.1.1
|
garages-amsterdam==3.0.0
|
||||||
|
|
||||||
# homeassistant.components.geniushub
|
# homeassistant.components.geniushub
|
||||||
geniushub-client==0.6.30
|
geniushub-client==0.6.30
|
||||||
|
@ -430,7 +430,7 @@ fritzconnection==1.7.2
|
|||||||
gTTS==2.2.3
|
gTTS==2.2.3
|
||||||
|
|
||||||
# homeassistant.components.garages_amsterdam
|
# homeassistant.components.garages_amsterdam
|
||||||
garages-amsterdam==2.1.1
|
garages-amsterdam==3.0.0
|
||||||
|
|
||||||
# homeassistant.components.geo_json_events
|
# homeassistant.components.geo_json_events
|
||||||
# homeassistant.components.usgs_earthquakes_feed
|
# homeassistant.components.usgs_earthquakes_feed
|
||||||
|
@ -9,7 +9,7 @@ import pytest
|
|||||||
def mock_cases():
|
def mock_cases():
|
||||||
"""Mock garages_amsterdam garages."""
|
"""Mock garages_amsterdam garages."""
|
||||||
with patch(
|
with patch(
|
||||||
"garages_amsterdam.get_garages",
|
"garages_amsterdam.GaragesAmsterdam.all_garages",
|
||||||
return_value=[
|
return_value=[
|
||||||
Mock(
|
Mock(
|
||||||
garage_name="IJDok",
|
garage_name="IJDok",
|
||||||
|
@ -57,7 +57,7 @@ async def test_error_handling(
|
|||||||
"""Test we get the form."""
|
"""Test we get the form."""
|
||||||
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.garages_amsterdam.config_flow.garages_amsterdam.get_garages",
|
"homeassistant.components.garages_amsterdam.config_flow.GaragesAmsterdam.all_garages",
|
||||||
side_effect=side_effect,
|
side_effect=side_effect,
|
||||||
):
|
):
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user