diff --git a/homeassistant/components/switchbot/switch.py b/homeassistant/components/switchbot/switch.py index cff1a0d0edc4..3fcf789da938 100644 --- a/homeassistant/components/switchbot/switch.py +++ b/homeassistant/components/switchbot/switch.py @@ -37,8 +37,8 @@ class SwitchBot(SwitchEntity, RestoreEntity): def __init__(self, mac, name, password) -> None: """Initialize the Switchbot.""" - self._state = None - self._last_run_success = None + self._state: bool | None = None + self._last_run_success: bool | None = None self._name = name self._mac = mac self._device = switchbot.Switchbot(mac=mac, password=password) @@ -75,7 +75,7 @@ class SwitchBot(SwitchEntity, RestoreEntity): @property def is_on(self) -> bool: """Return true if device is on.""" - return self._state + return bool(self._state) @property def unique_id(self) -> str: diff --git a/mypy.ini b/mypy.ini index 94aae01bc70f..02a2800a8012 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1609,9 +1609,6 @@ ignore_errors = true [mypy-homeassistant.components.stt.*] ignore_errors = true -[mypy-homeassistant.components.switchbot.*] -ignore_errors = true - [mypy-homeassistant.components.system_health.*] ignore_errors = true diff --git a/script/hassfest/mypy_config.py b/script/hassfest/mypy_config.py index 581b4865f7ce..0026be479a47 100644 --- a/script/hassfest/mypy_config.py +++ b/script/hassfest/mypy_config.py @@ -125,7 +125,6 @@ IGNORED_MODULES: Final[list[str]] = [ "homeassistant.components.sonos.*", "homeassistant.components.spotify.*", "homeassistant.components.stt.*", - "homeassistant.components.switchbot.*", "homeassistant.components.system_health.*", "homeassistant.components.system_log.*", "homeassistant.components.tado.*",