Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions homeassistant/components/ecobee/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
ATTR_FORECAST_WIND_SPEED,
WeatherEntity,
)
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.const import PRESSURE_HPA, PRESSURE_INHG, TEMP_FAHRENHEIT
from homeassistant.util import dt as dt_util
from homeassistant.util.pressure import convert as pressure_convert

from .const import (
_LOGGER,
Expand Down Expand Up @@ -113,7 +114,10 @@ def temperature_unit(self):
def pressure(self):
"""Return the pressure."""
try:
return int(self.get_forecast(0, "pressure"))
pressure = self.get_forecast(0, "pressure")
if not self.hass.config.units.is_metric:
return pressure_convert(pressure, PRESSURE_HPA, PRESSURE_INHG)
Comment thread
rianadon marked this conversation as resolved.
Outdated
return round(pressure)
except ValueError:
return None

Expand Down