Closed epenet closed 2 years ago
As per https://github.com/home-assistant/core/pull/80257
The name of a unit system should never be used for checking its type. Instance checks should be used instead:
Correct:
if hass.config.units is IMPERIAL_SYSTEM: pass if hass.config.units is METRIC_SYSTEM: pass
Incorrect:
if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL: pass if hass.config.units.name == CONF_UNIT_SYSTEM_METRIC: pass
Note: the name property of the IMPERIAL_SYSTEM is likely to get adjusted as soon as 2022.11 so this is an advance warning
name
IMPERIAL_SYSTEM
2022.11
Fixed thanks @epenet 👍
As per https://github.com/home-assistant/core/pull/80257
The name of a unit system should never be used for checking its type. Instance checks should be used instead:
Correct:
Incorrect: