From 9e7872e78b322bc910b2660cb1ec0672ecf68147 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 3 Aug 2023 12:15:08 -0700 Subject: [PATCH] Fix NWS twice_daily forecast day/night detection (#97703) --- homeassistant/components/nws/const.py | 1 - homeassistant/components/nws/weather.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/nws/const.py b/homeassistant/components/nws/const.py index 109af7a565b..e5718d5132f 100644 --- a/homeassistant/components/nws/const.py +++ b/homeassistant/components/nws/const.py @@ -26,7 +26,6 @@ CONF_STATION = "station" ATTRIBUTION = "Data from National Weather Service/NOAA" ATTR_FORECAST_DETAILED_DESCRIPTION = "detailed_description" -ATTR_FORECAST_DAYTIME = "daytime" CONDITION_CLASSES: dict[str, list[str]] = { ATTR_CONDITION_EXCEPTIONAL: [ diff --git a/homeassistant/components/nws/weather.py b/homeassistant/components/nws/weather.py index e8a35ba66f1..8ddf842cd62 100644 --- a/homeassistant/components/nws/weather.py +++ b/homeassistant/components/nws/weather.py @@ -9,6 +9,7 @@ from homeassistant.components.weather import ( ATTR_CONDITION_SUNNY, ATTR_FORECAST_CONDITION, ATTR_FORECAST_HUMIDITY, + ATTR_FORECAST_IS_DAYTIME, ATTR_FORECAST_NATIVE_DEW_POINT, ATTR_FORECAST_NATIVE_TEMP, ATTR_FORECAST_NATIVE_WIND_SPEED, @@ -36,7 +37,6 @@ from homeassistant.util.unit_system import UnitSystem from . import base_unique_id, device_info from .const import ( - ATTR_FORECAST_DAYTIME, ATTR_FORECAST_DETAILED_DESCRIPTION, ATTRIBUTION, CONDITION_CLASSES, @@ -101,7 +101,6 @@ if TYPE_CHECKING: """Forecast with extra fields needed for NWS.""" detailed_description: str | None - daytime: bool | None class NWSWeather(WeatherEntity): @@ -268,7 +267,7 @@ class NWSWeather(WeatherEntity): data[ATTR_FORECAST_HUMIDITY] = forecast_entry.get("relativeHumidity") if self.mode == DAYNIGHT: - data[ATTR_FORECAST_DAYTIME] = forecast_entry.get("isDaytime") + data[ATTR_FORECAST_IS_DAYTIME] = forecast_entry.get("isDaytime") time = forecast_entry.get("iconTime") weather = forecast_entry.get("iconWeather")