Clean up codespell words (#123541)

This commit is contained in:
Joost Lekkerkerker 2024-08-10 18:28:01 +02:00 committed by GitHub
parent 257742de46
commit 13b12a7657
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 18 additions and 20 deletions

View file

@ -168,11 +168,9 @@ def invalid_msg(
gateway: BaseAsyncGateway, child: ChildSensor, value_type_name: ValueType
) -> str:
"""Return a message for an invalid child during schema validation."""
pres = gateway.const.Presentation
presentation = gateway.const.Presentation
set_req = gateway.const.SetReq
return (
f"{pres(child.type).name} requires value_type {set_req[value_type_name].name}"
)
return f"{presentation(child.type).name} requires value_type {set_req[value_type_name].name}"
def validate_set_msg(
@ -202,10 +200,10 @@ def validate_child(
) -> defaultdict[Platform, list[DevId]]:
"""Validate a child. Returns a dict mapping hass platform names to list of DevId."""
validated: defaultdict[Platform, list[DevId]] = defaultdict(list)
pres: type[IntEnum] = gateway.const.Presentation
presentation: type[IntEnum] = gateway.const.Presentation
set_req: type[IntEnum] = gateway.const.SetReq
child_type_name: SensorType | None = next(
(member.name for member in pres if member.value == child.type), None
(member.name for member in presentation if member.value == child.type), None
)
if not child_type_name:
_LOGGER.warning("Child type %s is not supported", child.type)