From daec359fbdbafc4beae5947aac3e6d70cfd8be41 Mon Sep 17 00:00:00 2001 From: "Daniel Kollmannsberger (ext.)" Date: Tue, 30 Jan 2024 22:17:30 +0000 Subject: [PATCH] fix lint errors --- custom_components/hacs_vikunja_integration/__init__.py | 1 + custom_components/hacs_vikunja_integration/api.py | 5 +++-- custom_components/hacs_vikunja_integration/const.py | 3 ++- custom_components/hacs_vikunja_integration/coordinator.py | 3 ++- custom_components/hacs_vikunja_integration/todo.py | 5 ++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/custom_components/hacs_vikunja_integration/__init__.py b/custom_components/hacs_vikunja_integration/__init__.py index 9e019c0..dd5df36 100644 --- a/custom_components/hacs_vikunja_integration/__init__.py +++ b/custom_components/hacs_vikunja_integration/__init__.py @@ -1,3 +1,4 @@ +"""Initalization file.""" from __future__ import annotations from homeassistant.config_entries import ConfigEntry diff --git a/custom_components/hacs_vikunja_integration/api.py b/custom_components/hacs_vikunja_integration/api.py index 791627b..87e1829 100644 --- a/custom_components/hacs_vikunja_integration/api.py +++ b/custom_components/hacs_vikunja_integration/api.py @@ -1,3 +1,4 @@ +"""Connector file to define api access to vikunja api.""" from __future__ import annotations import asyncio @@ -38,7 +39,7 @@ def __init__( self._session = session async def list_projects(self) -> list[dict[str, any]]: - """List all accessable projects""" + """List all accessable projects.""" headers = { "Authorization": f"Bearer {self._api_key}", "Content-type": "application/json; charset=UTF-8", @@ -108,4 +109,4 @@ async def _api_wrapper( except Exception as exception: # pylint: disable=broad-except raise HacsVikunjaIntegrationApiClientError( "Something really wrong happened!" - ) from exception \ No newline at end of file + ) from exception diff --git a/custom_components/hacs_vikunja_integration/const.py b/custom_components/hacs_vikunja_integration/const.py index a6a8ebe..f8ac15e 100644 --- a/custom_components/hacs_vikunja_integration/const.py +++ b/custom_components/hacs_vikunja_integration/const.py @@ -1,3 +1,4 @@ +"""Define constants.""" from logging import Logger, getLogger LOGGER: Logger = getLogger(__package__) @@ -6,4 +7,4 @@ DOMAIN = "hacs_vikunja_integration" VERSION = "0.0.1" CONF_API_URL = "api_url" -CONF_API_KEY = "api_key" \ No newline at end of file +CONF_API_KEY = "api_key" diff --git a/custom_components/hacs_vikunja_integration/coordinator.py b/custom_components/hacs_vikunja_integration/coordinator.py index 9623122..f6edc59 100644 --- a/custom_components/hacs_vikunja_integration/coordinator.py +++ b/custom_components/hacs_vikunja_integration/coordinator.py @@ -1,3 +1,4 @@ +"""Define data handling inside home assistant.""" from __future__ import annotations from datetime import timedelta @@ -15,7 +16,7 @@ HacsVikunjaIntegrationApiClientAuthenticationError, HacsVikunjaIntegrationApiClientError, ) -from .const import DOMAIN, LOGGER +from .const import LOGGER class VikunjaDataUpdateCoordinator(DataUpdateCoordinator): diff --git a/custom_components/hacs_vikunja_integration/todo.py b/custom_components/hacs_vikunja_integration/todo.py index 8fb5f6e..e8b4069 100644 --- a/custom_components/hacs_vikunja_integration/todo.py +++ b/custom_components/hacs_vikunja_integration/todo.py @@ -2,7 +2,7 @@ from __future__ import annotations from datetime import date, datetime, timedelta -from typing import Any, cast +from typing import cast from homeassistant.components.todo import ( TodoItem, @@ -118,7 +118,6 @@ def todo_items(self) -> list[TodoItem] | None: async def async_update_todo_item(self, item: TodoItem) -> None: """Update a To-do item.""" - print("Running task update") uid: str = cast(str, item.uid) await self.coordinator.client.update_task( self._project_id, @@ -157,4 +156,4 @@ async def async_update_todo_item(self, item: TodoItem) -> None: # """ # parents = [task for task in tasks if task.get("parent") is None] # parents.sort(key=lambda task: task["position"]) -# return parents \ No newline at end of file +# return parents