homeassistant-blitzortung
homeassistant-blitzortung 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
Note:
Detected integration that 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.. Please report issue to the custom integration author for blitzortung using this method at custom_components/blitzortung/geo_location.py, line 100: if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
Seeing the same.
+1
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 10:06:59 AM (1 occurrences)
Last logged: 10:06:59 AM
Detected integration that 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.. Please report issue to the custom integration author for blitzortung using this method at custom_components/blitzortung/geo_location.py, line 100: if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
I am also seeing the same
This was fixed in https://github.com/mrk-its/homeassistant-blitzortung/pull/67 and can be closed now.