Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose dew point in Met.no #98543

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/met/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
ATTR_FORECAST_TIME,
ATTR_FORECAST_WIND_BEARING,
ATTR_WEATHER_CLOUD_COVERAGE,
ATTR_WEATHER_DEW_POINT,
ATTR_WEATHER_HUMIDITY,
ATTR_WEATHER_PRESSURE,
ATTR_WEATHER_TEMPERATURE,
Expand Down Expand Up @@ -199,4 +200,5 @@
ATTR_WEATHER_WIND_SPEED: "wind_speed",
ATTR_WEATHER_WIND_GUST_SPEED: "wind_gust",
ATTR_WEATHER_CLOUD_COVERAGE: "cloudiness",
ATTR_WEATHER_DEW_POINT: "dew_point",
}
2 changes: 1 addition & 1 deletion homeassistant/components/met/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/met",
"iot_class": "cloud_polling",
"loggers": ["metno"],
"requirements": ["PyMetno==0.10.0"]
"requirements": ["PyMetno==0.11.0"]
}
8 changes: 8 additions & 0 deletions homeassistant/components/met/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_TIME,
ATTR_WEATHER_CLOUD_COVERAGE,
ATTR_WEATHER_DEW_POINT,
ATTR_WEATHER_HUMIDITY,
ATTR_WEATHER_PRESSURE,
ATTR_WEATHER_TEMPERATURE,
Expand Down Expand Up @@ -202,6 +203,13 @@ def cloud_coverage(self) -> float | None:
ATTR_MAP[ATTR_WEATHER_CLOUD_COVERAGE]
)

@property
def native_dew_point(self) -> float | None:
"""Return the dew point."""
return self.coordinator.data.current_weather_data.get(
ATTR_MAP[ATTR_WEATHER_DEW_POINT]
)

def _forecast(self, hourly: bool) -> list[Forecast] | None:
"""Return the forecast array."""
if hourly:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/norway_air/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/norway_air",
"iot_class": "cloud_polling",
"loggers": ["metno"],
"requirements": ["PyMetno==0.10.0"]
"requirements": ["PyMetno==0.11.0"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ PyMetEireann==2021.8.0

# homeassistant.components.met
# homeassistant.components.norway_air
PyMetno==0.10.0
PyMetno==0.11.0

# homeassistant.components.keymitt_ble
PyMicroBot==0.0.9
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PyMetEireann==2021.8.0

# homeassistant.components.met
# homeassistant.components.norway_air
PyMetno==0.10.0
PyMetno==0.11.0

# homeassistant.components.keymitt_ble
PyMicroBot==0.0.9
Expand Down
1 change: 1 addition & 0 deletions tests/components/met/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def mock_weather():
"humidity": 50,
"wind_speed": 10,
"wind_bearing": "NE",
"dew_point": 12.1,
}
mock_data.get_forecast.return_value = {}
yield mock_data