Skip to content

Commit

Permalink
Enable strict typing
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrister committed Apr 22, 2022
1 parent 24b55c2 commit 492a961
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .strict-typing
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ homeassistant.components.peco.*
homeassistant.components.overkiz.*
homeassistant.components.persistent_notification.*
homeassistant.components.pi_hole.*
homeassistant.components.philips_air_purifier.*
homeassistant.components.powerwall.*
homeassistant.components.proximity.*
homeassistant.components.pvoutput.*
Expand Down
8 changes: 5 additions & 3 deletions homeassistant/components/philips_air_purifier/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _set_status(self, status: Status | None) -> None:
self.schedule_update_ha_state()

@property
def name(self):
def name(self) -> str:
"""
Return the purifier's name.
Expand All @@ -99,13 +99,15 @@ def name(self):
return self._status.name

@property
def available(self):
def available(self) -> bool:
"""Return whether the purifier is available."""
return self._status is not None

@property
def is_on(self):
def is_on(self) -> bool:
"""Return whether the purifier is turned on, i.e. the fan is turning."""
assert self._status is not None

return self._status.is_on

async def async_turn_on(
Expand Down
11 changes: 11 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,17 @@ no_implicit_optional = true
warn_return_any = true
warn_unreachable = true

[mypy-homeassistant.components.philips_air_purifier.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
warn_return_any = true
warn_unreachable = true

[mypy-homeassistant.components.powerwall.*]
check_untyped_defs = true
disallow_incomplete_defs = true
Expand Down

0 comments on commit 492a961

Please sign in to comment.