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
40 changed files with 249 additions and 110 deletions

View File

@ -125,9 +125,11 @@ class UnitSystem:
def name(self) -> str:
"""Return the name of the unit system."""
report(
"accesses the `name` property of the unit system. "
"This is deprecated and will stop working in Home Assistant 2023.1. "
"Please adjust to use instance check instead.",
(
"accesses the `name` property of the unit system. "
"This is deprecated and will stop working in Home Assistant 2023.1. "
"Please adjust to use instance check instead."
),
error_if_core=False,
)
if self is IMPERIAL_SYSTEM:
@ -139,9 +141,11 @@ class UnitSystem:
def is_metric(self) -> bool:
"""Determine if this is the metric unit system."""
report(
"accesses the `is_metric` property of the unit system. "
"This is deprecated and will stop working in Home Assistant 2023.1. "
"Please adjust to use instance check instead.",
(
"accesses the `is_metric` property of the unit system. "
"This is deprecated and will stop working in Home Assistant 2023.1. "
"Please adjust to use instance check instead."
),
error_if_core=False,
)
return self is METRIC_SYSTEM