mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Only do unit conversion of met
elevation when set in config entry (#88491)
convert met elevation unit only when it exists in config entry Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
parent
30ebc6604f
commit
7a884a9d61
@ -149,7 +149,7 @@ class MetWeatherData:
|
|||||||
self._coordinates: dict[str, str] | None = None
|
self._coordinates: dict[str, str] | None = None
|
||||||
|
|
||||||
def set_coordinates(self) -> bool:
|
def set_coordinates(self) -> bool:
|
||||||
"""Weather data inialization - set the coordinates."""
|
"""Weather data initialization - set the coordinates."""
|
||||||
if self._config.get(CONF_TRACK_HOME, False):
|
if self._config.get(CONF_TRACK_HOME, False):
|
||||||
latitude = self.hass.config.latitude
|
latitude = self.hass.config.latitude
|
||||||
longitude = self.hass.config.longitude
|
longitude = self.hass.config.longitude
|
||||||
@ -158,7 +158,6 @@ class MetWeatherData:
|
|||||||
latitude = self._config[CONF_LATITUDE]
|
latitude = self._config[CONF_LATITUDE]
|
||||||
longitude = self._config[CONF_LONGITUDE]
|
longitude = self._config[CONF_LONGITUDE]
|
||||||
elevation = self._config[CONF_ELEVATION]
|
elevation = self._config[CONF_ELEVATION]
|
||||||
|
|
||||||
if not self._is_metric:
|
if not self._is_metric:
|
||||||
elevation = int(
|
elevation = int(
|
||||||
round(
|
round(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user