Fix unique id issue for OpenWeatherMap (#74335)

pull/74522/head
G Johansson 2022-07-03 22:53:44 +02:00 committed by Paulus Schoutsen
parent fe437cc9b7
commit 2a1a6301a9
1 changed files with 9 additions and 8 deletions

View File

@ -22,10 +22,6 @@ from homeassistant.components.weather import (
ATTR_CONDITION_WINDY,
ATTR_CONDITION_WINDY_VARIANT,
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_NATIVE_PRECIPITATION,
ATTR_FORECAST_NATIVE_PRESSURE,
ATTR_FORECAST_NATIVE_TEMP,
ATTR_FORECAST_NATIVE_TEMP_LOW,
ATTR_FORECAST_PRECIPITATION_PROBABILITY,
ATTR_FORECAST_TIME,
)
@ -72,6 +68,11 @@ ATTR_API_FORECAST = "forecast"
UPDATE_LISTENER = "update_listener"
PLATFORMS = [Platform.SENSOR, Platform.WEATHER]
ATTR_FORECAST_PRECIPITATION = "precipitation"
ATTR_FORECAST_PRESSURE = "pressure"
ATTR_FORECAST_TEMP = "temperature"
ATTR_FORECAST_TEMP_LOW = "templow"
FORECAST_MODE_HOURLY = "hourly"
FORECAST_MODE_DAILY = "daily"
FORECAST_MODE_FREE_DAILY = "freedaily"
@ -266,7 +267,7 @@ FORECAST_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Condition",
),
SensorEntityDescription(
key=ATTR_FORECAST_NATIVE_PRECIPITATION,
key=ATTR_FORECAST_PRECIPITATION,
name="Precipitation",
native_unit_of_measurement=LENGTH_MILLIMETERS,
),
@ -276,19 +277,19 @@ FORECAST_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
native_unit_of_measurement=PERCENTAGE,
),
SensorEntityDescription(
key=ATTR_FORECAST_NATIVE_PRESSURE,
key=ATTR_FORECAST_PRESSURE,
name="Pressure",
native_unit_of_measurement=PRESSURE_HPA,
device_class=SensorDeviceClass.PRESSURE,
),
SensorEntityDescription(
key=ATTR_FORECAST_NATIVE_TEMP,
key=ATTR_FORECAST_TEMP,
name="Temperature",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
),
SensorEntityDescription(
key=ATTR_FORECAST_NATIVE_TEMP_LOW,
key=ATTR_FORECAST_TEMP_LOW,
name="Temperature Low",
native_unit_of_measurement=TEMP_CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,