diff --git a/custom_components/ms365_todo/integration/coordinator_integration.py b/custom_components/ms365_todo/integration/coordinator_integration.py index 36af582..60851ef 100644 --- a/custom_components/ms365_todo/integration/coordinator_integration.py +++ b/custom_components/ms365_todo/integration/coordinator_integration.py @@ -77,9 +77,7 @@ async def _async_todo_sensors(self): YAML_TODO_LIST_SCHEMA, ) ms365_todo_lists = list(ms365_task_dict.values()) - keys = await self._async_todo_entities(ms365_todo_lists) - - return keys + return await self._async_todo_entities(ms365_todo_lists) async def _async_todo_entities(self, ms365_todo_lists): keys = [] diff --git a/tests/integration/test_services.py b/tests/integration/test_services.py index a081799..17776ac 100644 --- a/tests/integration/test_services.py +++ b/tests/integration/test_services.py @@ -45,7 +45,7 @@ async def test_todo_services_ha( requests_mock: Mocker, ) -> None: """Test HA Services.""" - listener = 0 + list_name = "todo.test_todo_list_2" mock_call(requests_mock, URL.TODO_SAVE, "todo_save", method="post") mock_call(requests_mock, URL.TODO_GET_1, "todo_get_1") @@ -79,7 +79,7 @@ async def test_todo_services_ha( return_response=False, ) await hass.async_block_till_done() - listener += 1 + listener = 1 assert len(listener_setup.events) == listener assert [x for x in listener_setup.events if x.event_type == f"{DOMAIN}_new_todo"] @@ -163,7 +163,6 @@ async def test_todo_services_ms365( requests_mock: Mocker, ) -> None: """Test HA Services.""" - listener = 0 list_name = "todo.test_todo_list_1" mock_call(requests_mock, URL.TODO_SAVE, "todo_save", method="post") mock_call(requests_mock, URL.TODO_GET_1, "todo_get_1") @@ -181,7 +180,7 @@ async def test_todo_services_ms365( return_response=False, ) await hass.async_block_till_done() - listener += 1 + listener = 1 assert len(listener_setup.events) == listener assert [x for x in listener_setup.events if x.event_type == f"{DOMAIN}_new_todo"]