From c6f1ec34e2c837c1e7faf9399e5d4ebddcedbc0d Mon Sep 17 00:00:00 2001
From: "Mr. Bubbles" <manni@zapto.de>
Date: Thu, 11 Jul 2024 09:11:04 +0200
Subject: [PATCH] Fix bugs Habitica to-do lists (#121755)

---
 homeassistant/components/habitica/todo.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/homeassistant/components/habitica/todo.py b/homeassistant/components/habitica/todo.py
index 55465c87c8c..ab458f9f59f 100644
--- a/homeassistant/components/habitica/todo.py
+++ b/homeassistant/components/habitica/todo.py
@@ -127,6 +127,7 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
 
         if (
             self.entity_description.key is HabiticaTodoList.TODOS
+            and item.due is not None
         ):  # Only todos support a due date.
             date = item.due.isoformat()
         else:
@@ -149,14 +150,14 @@ class BaseHabiticaListEntity(HabiticaBase, TodoListEntity):
             # Score up or down if item status changed
             if (
                 current_item.status is TodoItemStatus.NEEDS_ACTION
-                and item.status is TodoItemStatus.COMPLETED
+                and item.status == TodoItemStatus.COMPLETED
             ):
                 score_result = (
                     await self.coordinator.api.tasks[item.uid].score["up"].post()
                 )
             elif (
                 current_item.status is TodoItemStatus.COMPLETED
-                and item.status is TodoItemStatus.NEEDS_ACTION
+                and item.status == TodoItemStatus.NEEDS_ACTION
             ):
                 score_result = (
                     await self.coordinator.api.tasks[item.uid].score["down"].post()
-- 
GitLab