mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Enable strict typing for Schlage (#131734)
This commit is contained in:
parent
d26c7a0536
commit
a831c37511
@ -405,6 +405,7 @@ homeassistant.components.ruuvitag_ble.*
|
|||||||
homeassistant.components.samsungtv.*
|
homeassistant.components.samsungtv.*
|
||||||
homeassistant.components.scene.*
|
homeassistant.components.scene.*
|
||||||
homeassistant.components.schedule.*
|
homeassistant.components.schedule.*
|
||||||
|
homeassistant.components.schlage.*
|
||||||
homeassistant.components.scrape.*
|
homeassistant.components.scrape.*
|
||||||
homeassistant.components.script.*
|
homeassistant.components.script.*
|
||||||
homeassistant.components.search.*
|
homeassistant.components.search.*
|
||||||
|
@ -44,6 +44,7 @@ class SchlageDataUpdateCoordinator(DataUpdateCoordinator[SchlageData]):
|
|||||||
super().__init__(
|
super().__init__(
|
||||||
hass, LOGGER, name=f"{DOMAIN} ({username})", update_interval=UPDATE_INTERVAL
|
hass, LOGGER, name=f"{DOMAIN} ({username})", update_interval=UPDATE_INTERVAL
|
||||||
)
|
)
|
||||||
|
self.data = SchlageData(locks={})
|
||||||
self.api = api
|
self.api = api
|
||||||
self.new_locks_callbacks: list[Callable[[dict[str, LockData]], None]] = []
|
self.new_locks_callbacks: list[Callable[[dict[str, LockData]], None]] = []
|
||||||
self.async_add_listener(self._add_remove_locks)
|
self.async_add_listener(self._add_remove_locks)
|
||||||
@ -83,9 +84,6 @@ class SchlageDataUpdateCoordinator(DataUpdateCoordinator[SchlageData]):
|
|||||||
@callback
|
@callback
|
||||||
def _add_remove_locks(self) -> None:
|
def _add_remove_locks(self) -> None:
|
||||||
"""Add newly discovered locks and remove nonexistent locks."""
|
"""Add newly discovered locks and remove nonexistent locks."""
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
|
|
||||||
device_registry = dr.async_get(self.hass)
|
device_registry = dr.async_get(self.hass)
|
||||||
devices = dr.async_entries_for_config_entry(
|
devices = dr.async_entries_for_config_entry(
|
||||||
device_registry, self.config_entry.entry_id
|
device_registry, self.config_entry.entry_id
|
||||||
|
10
mypy.ini
10
mypy.ini
@ -3806,6 +3806,16 @@ disallow_untyped_defs = true
|
|||||||
warn_return_any = true
|
warn_return_any = true
|
||||||
warn_unreachable = 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.*]
|
[mypy-homeassistant.components.scrape.*]
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
disallow_incomplete_defs = true
|
disallow_incomplete_defs = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user