mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Bump bring-api version to 1.0.1 (#137496)
This commit is contained in:
parent
283b0908c8
commit
12b3665872
@ -9,10 +9,12 @@ import logging
|
||||
from bring_api import (
|
||||
Bring,
|
||||
BringAuthException,
|
||||
BringItemsResponse,
|
||||
BringList,
|
||||
BringParseException,
|
||||
BringRequestException,
|
||||
BringUserSettingsResponse,
|
||||
)
|
||||
from bring_api.types import BringItemsResponse, BringList, BringUserSettingsResponse
|
||||
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
@ -62,20 +64,12 @@ class BringDataUpdateCoordinator(DataUpdateCoordinator[dict[str, BringData]]):
|
||||
raise UpdateFailed("Unable to connect and retrieve data from bring") from e
|
||||
except BringParseException as e:
|
||||
raise UpdateFailed("Unable to parse response from bring") from e
|
||||
except BringAuthException:
|
||||
# try to recover by refreshing access token, otherwise
|
||||
# initiate reauth flow
|
||||
try:
|
||||
await self.bring.retrieve_new_access_token()
|
||||
except (BringRequestException, BringParseException) as exc:
|
||||
raise UpdateFailed("Refreshing authentication token failed") from exc
|
||||
except BringAuthException as exc:
|
||||
raise ConfigEntryAuthFailed(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="setup_authentication_exception",
|
||||
translation_placeholders={CONF_EMAIL: self.bring.mail},
|
||||
) from exc
|
||||
return self.data
|
||||
except BringAuthException as e:
|
||||
raise ConfigEntryAuthFailed(
|
||||
translation_domain=DOMAIN,
|
||||
translation_key="setup_authentication_exception",
|
||||
translation_placeholders={CONF_EMAIL: self.bring.mail},
|
||||
) from e
|
||||
|
||||
if self.previous_lists - (
|
||||
current_lists := {lst.listUuid for lst in self.lists}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from bring_api.types import BringList
|
||||
from bring_api import BringList
|
||||
|
||||
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
@ -7,5 +7,5 @@
|
||||
"integration_type": "service",
|
||||
"iot_class": "cloud_polling",
|
||||
"loggers": ["bring_api"],
|
||||
"requirements": ["bring-api==1.0.0"]
|
||||
"requirements": ["bring-api==1.0.1"]
|
||||
}
|
||||
|
@ -6,9 +6,8 @@ from collections.abc import Callable
|
||||
from dataclasses import dataclass
|
||||
from enum import StrEnum
|
||||
|
||||
from bring_api import BringUserSettingsResponse
|
||||
from bring_api import BringList, BringUserSettingsResponse
|
||||
from bring_api.const import BRING_SUPPORTED_LOCALES
|
||||
from bring_api.types import BringList
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
|
@ -9,10 +9,10 @@ import uuid
|
||||
from bring_api import (
|
||||
BringItem,
|
||||
BringItemOperation,
|
||||
BringList,
|
||||
BringNotificationType,
|
||||
BringRequestException,
|
||||
)
|
||||
from bring_api.types import BringList
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.todo import (
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -650,7 +650,7 @@ boto3==1.34.131
|
||||
botocore==1.34.131
|
||||
|
||||
# homeassistant.components.bring
|
||||
bring-api==1.0.0
|
||||
bring-api==1.0.1
|
||||
|
||||
# homeassistant.components.broadlink
|
||||
broadlink==0.19.0
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -570,7 +570,7 @@ boschshcpy==0.2.91
|
||||
botocore==1.34.131
|
||||
|
||||
# homeassistant.components.bring
|
||||
bring-api==1.0.0
|
||||
bring-api==1.0.1
|
||||
|
||||
# homeassistant.components.broadlink
|
||||
broadlink==0.19.0
|
||||
|
@ -4,7 +4,7 @@ from collections.abc import Generator
|
||||
from unittest.mock import AsyncMock, patch
|
||||
import uuid
|
||||
|
||||
from bring_api.types import (
|
||||
from bring_api import (
|
||||
BringAuthResponse,
|
||||
BringItemsResponse,
|
||||
BringListResponse,
|
||||
|
@ -2,11 +2,7 @@
|
||||
|
||||
from unittest.mock import AsyncMock
|
||||
|
||||
from bring_api.exceptions import (
|
||||
BringAuthException,
|
||||
BringParseException,
|
||||
BringRequestException,
|
||||
)
|
||||
from bring_api import BringAuthException, BringParseException, BringRequestException
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.bring.const import DOMAIN
|
||||
|
@ -142,7 +142,6 @@ async def test_config_entry_not_ready_udpdate_failed(
|
||||
@pytest.mark.parametrize(
|
||||
("exception", "state"),
|
||||
[
|
||||
(None, ConfigEntryState.LOADED),
|
||||
(BringAuthException, ConfigEntryState.SETUP_ERROR),
|
||||
(BringRequestException, ConfigEntryState.SETUP_RETRY),
|
||||
(BringParseException, ConfigEntryState.SETUP_RETRY),
|
||||
@ -159,9 +158,8 @@ async def test_config_entry_not_ready_auth_error(
|
||||
|
||||
mock_bring_client.load_lists.side_effect = [
|
||||
mock_bring_client.load_lists.return_value,
|
||||
BringAuthException,
|
||||
exception,
|
||||
]
|
||||
mock_bring_client.retrieve_new_access_token.side_effect = exception
|
||||
|
||||
bring_config_entry.add_to_hass(hass)
|
||||
await hass.config_entries.async_setup(bring_config_entry.entry_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user