Adjust distance unit check in geonetnz_volcano (#80244)
* Adjust distance unit check in geonetnz_volcano * Use system compare * Use is not ==
This commit is contained in:
parent
0b7c84edbd
commit
3e0e845217
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.util.unit_system import IMPERIAL_SYSTEM
|
||||
|
||||
from .const import DEFAULT_RADIUS, DEFAULT_SCAN_INTERVAL, DOMAIN
|
||||
|
||||
|
@ -57,7 +58,7 @@ class GeonetnzVolcanoFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
if identifier in configured_instances(self.hass):
|
||||
return await self._show_form({"base": "already_configured"})
|
||||
|
||||
if self.hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL:
|
||||
if self.hass.config.units is IMPERIAL_SYSTEM:
|
||||
user_input[CONF_UNIT_SYSTEM] = CONF_UNIT_SYSTEM_IMPERIAL
|
||||
else:
|
||||
user_input[CONF_UNIT_SYSTEM] = CONF_UNIT_SYSTEM_METRIC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue