Activate mypy for Updater (#53950)

pull/54048/head
Milan Meulemans 2021-08-05 09:18:03 +02:00 committed by GitHub
parent 36c0478c4a
commit be880fdaa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View File

@ -1,4 +1,5 @@
"""Support for Home Assistant Updater binary sensors.""" """Support for Home Assistant Updater binary sensors."""
from __future__ import annotations
from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.helpers.update_coordinator import CoordinatorEntity from homeassistant.helpers.update_coordinator import CoordinatorEntity
@ -28,14 +29,14 @@ class UpdaterBinary(CoordinatorEntity, BinarySensorEntity):
return "updater" return "updater"
@property @property
def is_on(self) -> bool: def is_on(self) -> bool | None:
"""Return true if the binary sensor is on.""" """Return true if the binary sensor is on."""
if not self.coordinator.data: if not self.coordinator.data:
return None return None
return self.coordinator.data.update_available return self.coordinator.data.update_available
@property @property
def extra_state_attributes(self) -> dict: def extra_state_attributes(self) -> dict | None:
"""Return the optional state attributes.""" """Return the optional state attributes."""
if not self.coordinator.data: if not self.coordinator.data:
return None return None

View File

@ -1722,9 +1722,6 @@ ignore_errors = true
[mypy-homeassistant.components.unifi.*] [mypy-homeassistant.components.unifi.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.updater.*]
ignore_errors = true
[mypy-homeassistant.components.upnp.*] [mypy-homeassistant.components.upnp.*]
ignore_errors = true ignore_errors = true

View File

@ -170,7 +170,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.tradfri.*", "homeassistant.components.tradfri.*",
"homeassistant.components.tuya.*", "homeassistant.components.tuya.*",
"homeassistant.components.unifi.*", "homeassistant.components.unifi.*",
"homeassistant.components.updater.*",
"homeassistant.components.upnp.*", "homeassistant.components.upnp.*",
"homeassistant.components.velbus.*", "homeassistant.components.velbus.*",
"homeassistant.components.vera.*", "homeassistant.components.vera.*",