Skip to content

Commit

Permalink
Add Discovergy to strict-typing (home-assistant#101782)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede authored Oct 10, 2023
1 parent ba91aaa commit 9b785ef
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ homeassistant.components.devolo_home_control.*
homeassistant.components.devolo_home_network.*
homeassistant.components.dhcp.*
homeassistant.components.diagnostics.*
homeassistant.components.discovergy.*
homeassistant.components.dlna_dmr.*
homeassistant.components.dnsip.*
homeassistant.components.doorbird.*
Expand Down
9 changes: 0 additions & 9 deletions homeassistant/components/discovergy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ async def async_step_reauth(self, entry_data: Mapping[str, Any]) -> FlowResult:
"""Handle the initial step."""
self.existing_entry = await self.async_set_unique_id(self.context["unique_id"])

if entry_data is None:
return self.async_show_form(
step_id="reauth",
data_schema=make_schema(
self.existing_entry.data[CONF_EMAIL] or "",
self.existing_entry.data[CONF_PASSWORD] or "",
),
)

return await self._validate_and_save(entry_data, step_id="reauth")

async def _validate_and_save(
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/discovergy/system_health.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Provide info to system health."""
from typing import Any

from pydiscovergy.const import API_BASE

from homeassistant.components import system_health
Expand All @@ -13,7 +15,7 @@ def async_register(
register.async_register_info(system_health_info)


async def system_health_info(hass):
async def system_health_info(hass: HomeAssistant) -> dict[str, Any]:
"""Get info for the info page."""
return {
"api_endpoint_reachable": system_health.async_check_can_reach_url(
Expand Down
10 changes: 10 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,16 @@ warn_return_any = true
warn_unreachable = true
no_implicit_reexport = true

[mypy-homeassistant.components.discovergy.*]
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.dlna_dmr.*]
check_untyped_defs = true
disallow_incomplete_defs = true
Expand Down

0 comments on commit 9b785ef

Please sign in to comment.