mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Implement dew point in weather entity component (#95072)
This commit is contained in:
@@ -6,6 +6,7 @@ from __future__ import annotations
|
||||
|
||||
from homeassistant.components.weather import (
|
||||
ATTR_FORECAST_NATIVE_APPARENT_TEMP,
|
||||
ATTR_FORECAST_NATIVE_DEW_POINT,
|
||||
ATTR_FORECAST_NATIVE_PRECIPITATION,
|
||||
ATTR_FORECAST_NATIVE_PRESSURE,
|
||||
ATTR_FORECAST_NATIVE_TEMP,
|
||||
@@ -52,6 +53,11 @@ class MockWeather(MockEntity, WeatherEntity):
|
||||
"""Return the platform apparent temperature."""
|
||||
return self._handle("native_apparent_temperature")
|
||||
|
||||
@property
|
||||
def native_dew_point(self) -> float | None:
|
||||
"""Return the platform dewpoint temperature."""
|
||||
return self._handle("native_dew_point")
|
||||
|
||||
@property
|
||||
def native_temperature_unit(self) -> str | None:
|
||||
"""Return the unit of measurement for temperature."""
|
||||
@@ -203,6 +209,7 @@ class MockWeatherMockForecast(MockWeather):
|
||||
ATTR_FORECAST_NATIVE_TEMP: self.native_temperature,
|
||||
ATTR_FORECAST_NATIVE_APPARENT_TEMP: self.native_apparent_temperature,
|
||||
ATTR_FORECAST_NATIVE_TEMP_LOW: self.native_temperature,
|
||||
ATTR_FORECAST_NATIVE_DEW_POINT: self.native_dew_point,
|
||||
ATTR_FORECAST_NATIVE_PRESSURE: self.native_pressure,
|
||||
ATTR_FORECAST_NATIVE_WIND_SPEED: self.native_wind_speed,
|
||||
ATTR_FORECAST_WIND_BEARING: self.wind_bearing,
|
||||
|
||||
Reference in New Issue
Block a user