mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
Upgrade pymazda to 0.2.0 (#52775)
This commit is contained in:
parent
f7e4db512f
commit
2eb531b8c8
@ -50,7 +50,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
region = entry.data[CONF_REGION]
|
region = entry.data[CONF_REGION]
|
||||||
|
|
||||||
websession = aiohttp_client.async_get_clientsession(hass)
|
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:
|
try:
|
||||||
await mazda_client.validate_credentials()
|
await mazda_client.validate_credentials()
|
||||||
@ -166,7 +168,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
_LOGGER,
|
_LOGGER,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
update_method=async_update_data,
|
update_method=async_update_data,
|
||||||
update_interval=timedelta(seconds=60),
|
update_interval=timedelta(seconds=180),
|
||||||
)
|
)
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Mazda Connected Services",
|
"name": "Mazda Connected Services",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/mazda",
|
"documentation": "https://www.home-assistant.io/integrations/mazda",
|
||||||
"requirements": ["pymazda==0.1.6"],
|
"requirements": ["pymazda==0.2.0"],
|
||||||
"codeowners": ["@bdr99"],
|
"codeowners": ["@bdr99"],
|
||||||
"quality_scale": "platinum",
|
"quality_scale": "platinum",
|
||||||
"iot_class": "cloud_polling"
|
"iot_class": "cloud_polling"
|
||||||
|
@ -1570,7 +1570,7 @@ pymailgunner==1.4
|
|||||||
pymata-express==1.19
|
pymata-express==1.19
|
||||||
|
|
||||||
# homeassistant.components.mazda
|
# homeassistant.components.mazda
|
||||||
pymazda==0.1.6
|
pymazda==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.mediaroom
|
# homeassistant.components.mediaroom
|
||||||
pymediaroom==0.6.4.1
|
pymediaroom==0.6.4.1
|
||||||
|
@ -887,7 +887,7 @@ pymailgunner==1.4
|
|||||||
pymata-express==1.19
|
pymata-express==1.19
|
||||||
|
|
||||||
# homeassistant.components.mazda
|
# homeassistant.components.mazda
|
||||||
pymazda==0.1.6
|
pymazda==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.melcloud
|
# homeassistant.components.melcloud
|
||||||
pymelcloud==2.5.3
|
pymelcloud==2.5.3
|
||||||
|
@ -97,7 +97,7 @@ async def test_update_auth_failure(hass: HomeAssistant):
|
|||||||
"homeassistant.components.mazda.MazdaAPI.get_vehicles",
|
"homeassistant.components.mazda.MazdaAPI.get_vehicles",
|
||||||
side_effect=MazdaAuthenticationException("Login failed"),
|
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()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
flows = hass.config_entries.flow.async_progress()
|
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",
|
"homeassistant.components.mazda.MazdaAPI.get_vehicles",
|
||||||
side_effect=Exception("Unknown exception"),
|
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()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
entity = hass.states.get("sensor.my_mazda3_fuel_remaining_percentage")
|
entity = hass.states.get("sensor.my_mazda3_fuel_remaining_percentage")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user