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

@ -385,7 +385,10 @@ def async_numeric_state( # noqa: C901
except (ValueError, TypeError) as ex:
raise ConditionErrorMessage(
"numeric_state",
f"the 'below' entity {below} state '{below_entity.state}' cannot be processed as a number",
(
f"the 'below' entity {below} state '{below_entity.state}'"
" cannot be processed as a number"
),
) from ex
elif fvalue >= below:
condition_trace_set_result(False, state=fvalue, wanted_state_below=below)
@ -413,7 +416,10 @@ def async_numeric_state( # noqa: C901
except (ValueError, TypeError) as ex:
raise ConditionErrorMessage(
"numeric_state",
f"the 'above' entity {above} state '{above_entity.state}' cannot be processed as a number",
(
f"the 'above' entity {above} state '{above_entity.state}'"
" cannot be processed as a number"
),
) from ex
elif fvalue <= above:
condition_trace_set_result(False, state=fvalue, wanted_state_above=above)
@ -889,7 +895,10 @@ def zone_from_config(config: ConfigType) -> ConditionCheckerType:
errors.append(
ConditionErrorMessage(
"zone",
f"error matching {entity_id} with {zone_entity_id}: {ex.message}",
(
f"error matching {entity_id} with {zone_entity_id}:"
f" {ex.message}"
),
)
)