mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Fix bugs Habitica to-do lists (#121755)
This commit is contained in:
parent
43596f22a4
commit
c6f1ec34e2
@ -127,6 +127,7 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
self.entity_description.key is HabiticaTodoList.TODOS
|
self.entity_description.key is HabiticaTodoList.TODOS
|
||||||
|
and item.due is not None
|
||||||
): # Only todos support a due date.
|
): # Only todos support a due date.
|
||||||
date = item.due.isoformat()
|
date = item.due.isoformat()
|
||||||
else:
|
else:
|
||||||
@ -149,14 +150,14 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
|
|||||||
# Score up or down if item status changed
|
# Score up or down if item status changed
|
||||||
if (
|
if (
|
||||||
current_item.status is TodoItemStatus.NEEDS_ACTION
|
current_item.status is TodoItemStatus.NEEDS_ACTION
|
||||||
and item.status is TodoItemStatus.COMPLETED
|
and item.status == TodoItemStatus.COMPLETED
|
||||||
):
|
):
|
||||||
score_result = (
|
score_result = (
|
||||||
await self.coordinator.api.tasks[item.uid].score["up"].post()
|
await self.coordinator.api.tasks[item.uid].score["up"].post()
|
||||||
)
|
)
|
||||||
elif (
|
elif (
|
||||||
current_item.status is TodoItemStatus.COMPLETED
|
current_item.status is TodoItemStatus.COMPLETED
|
||||||
and item.status is TodoItemStatus.NEEDS_ACTION
|
and item.status == TodoItemStatus.NEEDS_ACTION
|
||||||
):
|
):
|
||||||
score_result = (
|
score_result = (
|
||||||
await self.coordinator.api.tasks[item.uid].score["down"].post()
|
await self.coordinator.api.tasks[item.uid].score["down"].post()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user