mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +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 (
|
from bring_api import (
|
||||||
Bring,
|
Bring,
|
||||||
BringAuthException,
|
BringAuthException,
|
||||||
|
BringItemsResponse,
|
||||||
|
BringList,
|
||||||
BringParseException,
|
BringParseException,
|
||||||
BringRequestException,
|
BringRequestException,
|
||||||
|
BringUserSettingsResponse,
|
||||||
)
|
)
|
||||||
from bring_api.types import BringItemsResponse, BringList, BringUserSettingsResponse
|
|
||||||
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
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
|
raise UpdateFailed("Unable to connect and retrieve data from bring") from e
|
||||||
except BringParseException as e:
|
except BringParseException as e:
|
||||||
raise UpdateFailed("Unable to parse response from bring") from e
|
raise UpdateFailed("Unable to parse response from bring") from e
|
||||||
except BringAuthException:
|
except BringAuthException as e:
|
||||||
# try to recover by refreshing access token, otherwise
|
raise ConfigEntryAuthFailed(
|
||||||
# initiate reauth flow
|
translation_domain=DOMAIN,
|
||||||
try:
|
translation_key="setup_authentication_exception",
|
||||||
await self.bring.retrieve_new_access_token()
|
translation_placeholders={CONF_EMAIL: self.bring.mail},
|
||||||
except (BringRequestException, BringParseException) as exc:
|
) from e
|
||||||
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
|
|
||||||
|
|
||||||
if self.previous_lists - (
|
if self.previous_lists - (
|
||||||
current_lists := {lst.listUuid for lst in self.lists}
|
current_lists := {lst.listUuid for lst in self.lists}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
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.device_registry import DeviceEntryType, DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["bring_api"],
|
"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 dataclasses import dataclass
|
||||||
from enum import StrEnum
|
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.const import BRING_SUPPORTED_LOCALES
|
||||||
from bring_api.types import BringList
|
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
|
@ -9,10 +9,10 @@ import uuid
|
|||||||
from bring_api import (
|
from bring_api import (
|
||||||
BringItem,
|
BringItem,
|
||||||
BringItemOperation,
|
BringItemOperation,
|
||||||
|
BringList,
|
||||||
BringNotificationType,
|
BringNotificationType,
|
||||||
BringRequestException,
|
BringRequestException,
|
||||||
)
|
)
|
||||||
from bring_api.types import BringList
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.todo import (
|
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
|
botocore==1.34.131
|
||||||
|
|
||||||
# homeassistant.components.bring
|
# homeassistant.components.bring
|
||||||
bring-api==1.0.0
|
bring-api==1.0.1
|
||||||
|
|
||||||
# homeassistant.components.broadlink
|
# homeassistant.components.broadlink
|
||||||
broadlink==0.19.0
|
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
|
botocore==1.34.131
|
||||||
|
|
||||||
# homeassistant.components.bring
|
# homeassistant.components.bring
|
||||||
bring-api==1.0.0
|
bring-api==1.0.1
|
||||||
|
|
||||||
# homeassistant.components.broadlink
|
# homeassistant.components.broadlink
|
||||||
broadlink==0.19.0
|
broadlink==0.19.0
|
||||||
|
@ -4,7 +4,7 @@ from collections.abc import Generator
|
|||||||
from unittest.mock import AsyncMock, patch
|
from unittest.mock import AsyncMock, patch
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from bring_api.types import (
|
from bring_api import (
|
||||||
BringAuthResponse,
|
BringAuthResponse,
|
||||||
BringItemsResponse,
|
BringItemsResponse,
|
||||||
BringListResponse,
|
BringListResponse,
|
||||||
|
@ -2,11 +2,7 @@
|
|||||||
|
|
||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
from bring_api.exceptions import (
|
from bring_api import BringAuthException, BringParseException, BringRequestException
|
||||||
BringAuthException,
|
|
||||||
BringParseException,
|
|
||||||
BringRequestException,
|
|
||||||
)
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.bring.const import DOMAIN
|
from homeassistant.components.bring.const import DOMAIN
|
||||||
|
@ -142,7 +142,6 @@ async def test_config_entry_not_ready_udpdate_failed(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("exception", "state"),
|
("exception", "state"),
|
||||||
[
|
[
|
||||||
(None, ConfigEntryState.LOADED),
|
|
||||||
(BringAuthException, ConfigEntryState.SETUP_ERROR),
|
(BringAuthException, ConfigEntryState.SETUP_ERROR),
|
||||||
(BringRequestException, ConfigEntryState.SETUP_RETRY),
|
(BringRequestException, ConfigEntryState.SETUP_RETRY),
|
||||||
(BringParseException, 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.side_effect = [
|
||||||
mock_bring_client.load_lists.return_value,
|
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)
|
bring_config_entry.add_to_hass(hass)
|
||||||
await hass.config_entries.async_setup(bring_config_entry.entry_id)
|
await hass.config_entries.async_setup(bring_config_entry.entry_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user