Add strict typing for WLED (#79822)
* Add strict typing for WLED * Update backoff constraintpull/79880/head
parent
14d2bbfcd6
commit
33c94b0052
|
@ -285,6 +285,7 @@ homeassistant.components.websocket_api.*
|
|||
homeassistant.components.wemo.*
|
||||
homeassistant.components.whois.*
|
||||
homeassistant.components.wiz.*
|
||||
homeassistant.components.wled.*
|
||||
homeassistant.components.worldclock.*
|
||||
homeassistant.components.yale_smart_alarm.*
|
||||
homeassistant.components.zeroconf.*
|
||||
|
|
|
@ -92,7 +92,7 @@ class WLEDNumber(WLEDEntity, NumberEntity):
|
|||
@property
|
||||
def native_value(self) -> float | None:
|
||||
"""Return the current WLED segment number value."""
|
||||
return getattr(
|
||||
return getattr( # type: ignore[no-any-return]
|
||||
self.coordinator.data.state.segments[self._segment],
|
||||
self.entity_description.key,
|
||||
)
|
||||
|
|
|
@ -114,9 +114,8 @@ multidict>=6.0.2
|
|||
# https://github.com/home-assistant/core/pull/68176
|
||||
authlib<1.0
|
||||
|
||||
# Pin backoff for compatibility until most libraries have been updated
|
||||
# https://github.com/home-assistant/core/pull/70817
|
||||
backoff<2.0
|
||||
# Version 2.0 added typing, prevent accidental fallbacks
|
||||
backoff>=2.0
|
||||
|
||||
# Breaking change in version
|
||||
# https://github.com/samuelcolvin/pydantic/issues/4092
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -2604,6 +2604,16 @@ disallow_untyped_defs = true
|
|||
warn_return_any = true
|
||||
warn_unreachable = true
|
||||
|
||||
[mypy-homeassistant.components.wled.*]
|
||||
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.worldclock.*]
|
||||
check_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
|
|
|
@ -124,9 +124,8 @@ multidict>=6.0.2
|
|||
# https://github.com/home-assistant/core/pull/68176
|
||||
authlib<1.0
|
||||
|
||||
# Pin backoff for compatibility until most libraries have been updated
|
||||
# https://github.com/home-assistant/core/pull/70817
|
||||
backoff<2.0
|
||||
# Version 2.0 added typing, prevent accidental fallbacks
|
||||
backoff>=2.0
|
||||
|
||||
# Breaking change in version
|
||||
# https://github.com/samuelcolvin/pydantic/issues/4092
|
||||
|
|
Loading…
Reference in New Issue