parent
54d005a3b8
commit
2b3f5319d6
|
@ -35,7 +35,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
|
||||
try:
|
||||
await bring.login()
|
||||
await bring.loadLists()
|
||||
await bring.load_lists()
|
||||
except BringRequestException as e:
|
||||
raise ConfigEntryNotReady(
|
||||
f"Timeout while connecting for email '{email}'"
|
||||
|
|
|
@ -54,7 +54,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
|
||||
try:
|
||||
await bring.login()
|
||||
await bring.loadLists()
|
||||
await bring.load_lists()
|
||||
except BringRequestException:
|
||||
errors["base"] = "cannot_connect"
|
||||
except BringAuthException:
|
||||
|
|
|
@ -40,7 +40,7 @@ class BringDataUpdateCoordinator(DataUpdateCoordinator[dict[str, BringData]]):
|
|||
|
||||
async def _async_update_data(self) -> dict[str, BringData]:
|
||||
try:
|
||||
lists_response = await self.bring.loadLists()
|
||||
lists_response = await self.bring.load_lists()
|
||||
except BringRequestException as e:
|
||||
raise UpdateFailed("Unable to connect and retrieve data from bring") from e
|
||||
except BringParseException as e:
|
||||
|
@ -49,7 +49,7 @@ class BringDataUpdateCoordinator(DataUpdateCoordinator[dict[str, BringData]]):
|
|||
list_dict = {}
|
||||
for lst in lists_response["lists"]:
|
||||
try:
|
||||
items = await self.bring.getItems(lst["listUuid"])
|
||||
items = await self.bring.get_list(lst["listUuid"])
|
||||
except BringRequestException as e:
|
||||
raise UpdateFailed(
|
||||
"Unable to connect and retrieve data from bring"
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/bring",
|
||||
"integration_type": "service",
|
||||
"iot_class": "cloud_polling",
|
||||
"requirements": ["bring-api==0.1.1"]
|
||||
"requirements": ["bring-api==0.3.1"]
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class BringTodoListEntity(
|
|||
async def async_create_todo_item(self, item: TodoItem) -> None:
|
||||
"""Add an item to the To-do list."""
|
||||
try:
|
||||
await self.coordinator.bring.saveItem(
|
||||
await self.coordinator.bring.save_item(
|
||||
self.bring_list["listUuid"], item.summary, item.description or ""
|
||||
)
|
||||
except BringRequestException as e:
|
||||
|
@ -123,14 +123,14 @@ class BringTodoListEntity(
|
|||
assert item.uid
|
||||
|
||||
if item.status == TodoItemStatus.COMPLETED:
|
||||
await self.coordinator.bring.removeItem(
|
||||
await self.coordinator.bring.remove_item(
|
||||
bring_list["listUuid"],
|
||||
item.uid,
|
||||
)
|
||||
|
||||
elif item.summary == item.uid:
|
||||
try:
|
||||
await self.coordinator.bring.updateItem(
|
||||
await self.coordinator.bring.update_item(
|
||||
bring_list["listUuid"],
|
||||
item.uid,
|
||||
item.description or "",
|
||||
|
@ -139,11 +139,11 @@ class BringTodoListEntity(
|
|||
raise HomeAssistantError("Unable to update todo item for bring") from e
|
||||
else:
|
||||
try:
|
||||
await self.coordinator.bring.removeItem(
|
||||
await self.coordinator.bring.remove_item(
|
||||
bring_list["listUuid"],
|
||||
item.uid,
|
||||
)
|
||||
await self.coordinator.bring.saveItem(
|
||||
await self.coordinator.bring.save_tem(
|
||||
bring_list["listUuid"],
|
||||
item.summary,
|
||||
item.description or "",
|
||||
|
@ -157,7 +157,7 @@ class BringTodoListEntity(
|
|||
"""Delete an item from the To-do list."""
|
||||
for uid in uids:
|
||||
try:
|
||||
await self.coordinator.bring.removeItem(
|
||||
await self.coordinator.bring.remove_item(
|
||||
self.bring_list["listUuid"], uid
|
||||
)
|
||||
except BringRequestException as e:
|
||||
|
|
|
@ -600,7 +600,7 @@ boschshcpy==0.2.75
|
|||
boto3==1.33.13
|
||||
|
||||
# homeassistant.components.bring
|
||||
bring-api==0.1.1
|
||||
bring-api==0.3.1
|
||||
|
||||
# homeassistant.components.broadlink
|
||||
broadlink==0.18.3
|
||||
|
|
|
@ -508,7 +508,7 @@ bond-async==0.2.1
|
|||
boschshcpy==0.2.75
|
||||
|
||||
# homeassistant.components.bring
|
||||
bring-api==0.1.1
|
||||
bring-api==0.3.1
|
||||
|
||||
# homeassistant.components.broadlink
|
||||
broadlink==0.18.3
|
||||
|
|
|
@ -37,7 +37,7 @@ def mock_bring_client() -> Generator[AsyncMock, None, None]:
|
|||
client = mock_client.return_value
|
||||
client.uuid = UUID
|
||||
client.login.return_value = True
|
||||
client.loadLists.return_value = {"lists": []}
|
||||
client.load_lists.return_value = {"lists": []}
|
||||
yield client
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue