mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix NWS twice_daily forecast day/night detection (#97703)
This commit is contained in:
parent
6fd60024cc
commit
9e7872e78b
@ -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: [
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user