String formatting and max line length - Part 7 (#84532)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Franck Nijhof 2022-12-27 11:18:56 +01:00 committed by GitHub
parent 3149c52be1
commit d4f69a3652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 249 additions and 110 deletions

View file

@ -145,7 +145,12 @@ class EntityPlatform:
def __repr__(self) -> str:
"""Represent an EntityPlatform."""
return f"<EntityPlatform domain={self.domain} platform_name={self.platform_name} config_entry={self.config_entry}>"
return (
"<EntityPlatform "
f"domain={self.domain} "
f"platform_name={self.platform_name} "
f"config_entry={self.config_entry}>"
)
@callback
def _get_parallel_updates_semaphore(
@ -191,7 +196,10 @@ class EntityPlatform:
platform, "setup_platform"
):
self.logger.error(
"The %s platform for the %s integration does not support platform setup. Please remove it from your config.",
(
"The %s platform for the %s integration does not support platform"
" setup. Please remove it from your config."
),
self.platform_name,
self.domain,
)
@ -327,8 +335,10 @@ class EntityPlatform:
return False
except asyncio.TimeoutError:
logger.error(
"Setup of platform %s is taking longer than %s seconds."
" Startup will proceed without waiting any longer.",
(
"Setup of platform %s is taking longer than %s seconds."
" Startup will proceed without waiting any longer."
),
self.platform_name,
SLOW_SETUP_MAX_WAIT,
)
@ -514,9 +524,15 @@ class EntityPlatform:
f"Platform {self.platform_name} does not generate unique IDs. "
)
if entity.entity_id:
msg += f"ID {entity.unique_id} is already used by {registered_entity_id} - ignoring {entity.entity_id}"
msg += (
f"ID {entity.unique_id} is already used by"
f" {registered_entity_id} - ignoring {entity.entity_id}"
)
else:
msg += f"ID {entity.unique_id} already exists - ignoring {registered_entity_id}"
msg += (
f"ID {entity.unique_id} already exists - ignoring"
f" {registered_entity_id}"
)
self.logger.error(msg)
entity.add_to_platform_abort()
return