Enable strict typing for Schlage (#131734)

This commit is contained in:
David Knowles 2024-11-28 02:29:15 -05:00 committed by GitHub
parent d26c7a0536
commit a831c37511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 deletions

View File

@ -405,6 +405,7 @@ homeassistant.components.ruuvitag_ble.*
homeassistant.components.samsungtv.*
homeassistant.components.scene.*
homeassistant.components.schedule.*
homeassistant.components.schlage.*
homeassistant.components.scrape.*
homeassistant.components.script.*
homeassistant.components.search.*

View File

@ -44,6 +44,7 @@ class SchlageDataUpdateCoordinator(DataUpdateCoordinator[SchlageData]):
super().__init__(
hass, LOGGER, name=f"{DOMAIN} ({username})", update_interval=UPDATE_INTERVAL
)
self.data = SchlageData(locks={})
self.api = api
self.new_locks_callbacks: list[Callable[[dict[str, LockData]], None]] = []
self.async_add_listener(self._add_remove_locks)
@ -83,9 +84,6 @@ class SchlageDataUpdateCoordinator(DataUpdateCoordinator[SchlageData]):
@callback
def _add_remove_locks(self) -> None:
"""Add newly discovered locks and remove nonexistent locks."""
if self.data is None:
return
device_registry = dr.async_get(self.hass)
devices = dr.async_entries_for_config_entry(
device_registry, self.config_entry.entry_id

View File

@ -3806,6 +3806,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.schlage.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.scrape.*]
check_untyped_defs = true
disallow_incomplete_defs = true