From 2eb531b8c8f1994665ad1a0e9b89879a72331f09 Mon Sep 17 00:00:00 2001 From: Brandon Rothweiler Date: Fri, 9 Jul 2021 01:55:26 -0400 Subject: [PATCH] Upgrade pymazda to 0.2.0 (#52775) --- homeassistant/components/mazda/__init__.py | 6 ++++-- homeassistant/components/mazda/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/mazda/test_init.py | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/mazda/__init__.py b/homeassistant/components/mazda/__init__.py index d704cfb7f44..921dd4c06c5 100644 --- a/homeassistant/components/mazda/__init__.py +++ b/homeassistant/components/mazda/__init__.py @@ -50,7 +50,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: region = entry.data[CONF_REGION] websession = aiohttp_client.async_get_clientsession(hass) - mazda_client = MazdaAPI(email, password, region, websession) + mazda_client = MazdaAPI( + email, password, region, websession=websession, use_cached_vehicle_list=True + ) try: await mazda_client.validate_credentials() @@ -166,7 +168,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: _LOGGER, name=DOMAIN, update_method=async_update_data, - update_interval=timedelta(seconds=60), + update_interval=timedelta(seconds=180), ) hass.data.setdefault(DOMAIN, {}) diff --git a/homeassistant/components/mazda/manifest.json b/homeassistant/components/mazda/manifest.json index dd169159bc8..cc12653f5cb 100644 --- a/homeassistant/components/mazda/manifest.json +++ b/homeassistant/components/mazda/manifest.json @@ -3,7 +3,7 @@ "name": "Mazda Connected Services", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/mazda", - "requirements": ["pymazda==0.1.6"], + "requirements": ["pymazda==0.2.0"], "codeowners": ["@bdr99"], "quality_scale": "platinum", "iot_class": "cloud_polling" diff --git a/requirements_all.txt b/requirements_all.txt index b7f01f0edef..2efde4e9213 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1570,7 +1570,7 @@ pymailgunner==1.4 pymata-express==1.19 # homeassistant.components.mazda -pymazda==0.1.6 +pymazda==0.2.0 # homeassistant.components.mediaroom pymediaroom==0.6.4.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 34c2d899d23..66a6423b88d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -887,7 +887,7 @@ pymailgunner==1.4 pymata-express==1.19 # homeassistant.components.mazda -pymazda==0.1.6 +pymazda==0.2.0 # homeassistant.components.melcloud pymelcloud==2.5.3 diff --git a/tests/components/mazda/test_init.py b/tests/components/mazda/test_init.py index 0c47ae8f2e0..8b135f15e80 100644 --- a/tests/components/mazda/test_init.py +++ b/tests/components/mazda/test_init.py @@ -97,7 +97,7 @@ async def test_update_auth_failure(hass: HomeAssistant): "homeassistant.components.mazda.MazdaAPI.get_vehicles", side_effect=MazdaAuthenticationException("Login failed"), ): - async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=61)) + async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=181)) await hass.async_block_till_done() flows = hass.config_entries.flow.async_progress() @@ -136,7 +136,7 @@ async def test_update_general_failure(hass: HomeAssistant): "homeassistant.components.mazda.MazdaAPI.get_vehicles", side_effect=Exception("Unknown exception"), ): - async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=61)) + async_fire_time_changed(hass, dt_util.utcnow() + timedelta(seconds=181)) await hass.async_block_till_done() entity = hass.states.get("sensor.my_mazda3_fuel_remaining_percentage")