audi_connect_ha
audi_connect_ha copied to clipboard
The name property of the Unit System is deprecated
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
PR created and awaiting merge: https://github.com/arjenvrh/audi_connect_ha/pull/160