String formatting and max line length - Part 7 (#84532)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
3149c52be1
commit
d4f69a3652
40 changed files with 249 additions and 110 deletions
|
@ -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}"
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue