From b4cba018709562892ef8f8b0bca74a2fb7cdb868 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:17:01 +0200 Subject: [PATCH] Fix implicit-return in command_line (#122838) --- homeassistant/components/command_line/cover.py | 5 ++--- homeassistant/components/command_line/switch.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/command_line/cover.py b/homeassistant/components/command_line/cover.py index 6400be7d92f..2c6ec78b689 100644 --- a/homeassistant/components/command_line/cover.py +++ b/homeassistant/components/command_line/cover.py @@ -4,7 +4,7 @@ from __future__ import annotations import asyncio from datetime import datetime, timedelta -from typing import TYPE_CHECKING, Any, cast +from typing import Any, cast from homeassistant.components.cover import CoverEntity from homeassistant.const import ( @@ -145,8 +145,7 @@ class CommandCover(ManualTriggerEntity, CoverEntity): if self._command_state: LOGGER.info("Running state value command: %s", self._command_state) return await async_check_output_or_log(self._command_state, self._timeout) - if TYPE_CHECKING: - return None + return None async def _update_entity_state(self, now: datetime | None = None) -> None: """Update the state of the entity.""" diff --git a/homeassistant/components/command_line/switch.py b/homeassistant/components/command_line/switch.py index 8a75276c8b4..f8e9d21cf23 100644 --- a/homeassistant/components/command_line/switch.py +++ b/homeassistant/components/command_line/switch.py @@ -4,7 +4,7 @@ from __future__ import annotations import asyncio from datetime import datetime, timedelta -from typing import TYPE_CHECKING, Any, cast +from typing import Any, cast from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchEntity from homeassistant.const import ( @@ -147,8 +147,7 @@ class CommandSwitch(ManualTriggerEntity, SwitchEntity): if self._value_template: return await self._async_query_state_value(self._command_state) return await self._async_query_state_code(self._command_state) - if TYPE_CHECKING: - return None + return None async def _update_entity_state(self, now: datetime | None = None) -> None: """Update the state of the entity."""