mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Revert "Fix missing id in Habitica completed todos API response" (#126142)
Revert "Fix missing id in Habitica completed todos API response (#124565)" This reverts commit c9e7c76ee55c628e59c659bd331ab6bf0352bed6.
This commit is contained in:
parent
3c99fad6b9
commit
b787c2617b
@ -56,14 +56,7 @@ class HabiticaDataUpdateCoordinator(DataUpdateCoordinator[HabiticaData]):
|
|||||||
try:
|
try:
|
||||||
user_response = await self.api.user.get()
|
user_response = await self.api.user.get()
|
||||||
tasks_response = await self.api.tasks.user.get()
|
tasks_response = await self.api.tasks.user.get()
|
||||||
tasks_response.extend(
|
tasks_response.extend(await self.api.tasks.user.get(type="completedTodos"))
|
||||||
[
|
|
||||||
{"id": task["_id"], **task}
|
|
||||||
for task in await self.api.tasks.user.get(type="completedTodos")
|
|
||||||
if task.get("_id")
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
except ClientResponseError as error:
|
except ClientResponseError as error:
|
||||||
if error.status == HTTPStatus.TOO_MANY_REQUESTS:
|
if error.status == HTTPStatus.TOO_MANY_REQUESTS:
|
||||||
_LOGGER.debug("Currently rate limited, skipping update")
|
_LOGGER.debug("Currently rate limited, skipping update")
|
||||||
|
@ -74,20 +74,7 @@ def common_requests(aioclient_mock: AiohttpClientMocker) -> AiohttpClientMocker:
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
aioclient_mock.get(
|
|
||||||
"https://habitica.com/api/v3/tasks/user?type=completedTodos",
|
|
||||||
json={
|
|
||||||
"data": [
|
|
||||||
{
|
|
||||||
"text": "this is a mock todo #5",
|
|
||||||
"id": 5,
|
|
||||||
"_id": 5,
|
|
||||||
"type": "todo",
|
|
||||||
"completed": True,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
)
|
|
||||||
aioclient_mock.get(
|
aioclient_mock.get(
|
||||||
"https://habitica.com/api/v3/tasks/user",
|
"https://habitica.com/api/v3/tasks/user",
|
||||||
json={
|
json={
|
||||||
@ -102,6 +89,19 @@ def common_requests(aioclient_mock: AiohttpClientMocker) -> AiohttpClientMocker:
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
aioclient_mock.get(
|
||||||
|
"https://habitica.com/api/v3/tasks/user?type=completedTodos",
|
||||||
|
json={
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"text": "this is a mock todo #5",
|
||||||
|
"id": 5,
|
||||||
|
"type": "todo",
|
||||||
|
"completed": True,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
aioclient_mock.post(
|
aioclient_mock.post(
|
||||||
"https://habitica.com/api/v3/tasks/user",
|
"https://habitica.com/api/v3/tasks/user",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user