diff --git a/homeassistant/components/openweathermap/weather.py b/homeassistant/components/openweathermap/weather.py index 7908beb61d6..63d63c30147 100644 --- a/homeassistant/components/openweathermap/weather.py +++ b/homeassistant/components/openweathermap/weather.py @@ -1,6 +1,7 @@ """Support for the OpenWeatherMap (OWM) service.""" from homeassistant.components.weather import WeatherEntity -from homeassistant.const import TEMP_CELSIUS +from homeassistant.const import PRESSURE_HPA, PRESSURE_INHG, TEMP_CELSIUS +from homeassistant.util.pressure import convert as pressure_convert from .const import ( ATTR_API_CONDITION, @@ -82,7 +83,12 @@ class OpenWeatherMapWeather(WeatherEntity): @property def pressure(self): """Return the pressure.""" - return self._weather_coordinator.data[ATTR_API_PRESSURE] + pressure = self._weather_coordinator.data[ATTR_API_PRESSURE] + # OpenWeatherMap returns pressure in hPA, so convert to + # inHg if we aren't using metric. + if not self.hass.config.units.is_metric and pressure: + return pressure_convert(pressure, PRESSURE_HPA, PRESSURE_INHG) + return pressure @property def humidity(self):