Activate mypy for Updater (#53950)
parent
36c0478c4a
commit
be880fdaa9
|
@ -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
|
||||||
|
|
3
mypy.ini
3
mypy.ini
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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.*",
|
||||||
|
|
Loading…
Reference in New Issue