Use precipitation_intensity class in integrations (#80615)

This commit is contained in:
epenet 2022-10-26 13:32:06 +02:00 committed by GitHub
parent 7a04ba96f3
commit 7796f361fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 4 deletions

View File

@ -209,6 +209,7 @@ FORECAST_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key=ATTR_API_FORECAST_PRECIPITATION,
name="Precipitation",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key=ATTR_API_FORECAST_PRECIPITATION_PROBABILITY,
@ -266,6 +267,7 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key=ATTR_API_RAIN,
name="Rain",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key=ATTR_API_RAIN_PROB,
@ -277,6 +279,7 @@ WEATHER_SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key=ATTR_API_SNOW,
name="Snow",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key=ATTR_API_SNOW_PROB,

View File

@ -194,9 +194,9 @@ SENSOR_DESCRIPTIONS = (
SensorEntityDescription(
key=TYPE_HOURLYRAININ,
name="Hourly rain rate",
icon="mdi:water",
native_unit_of_measurement=UnitOfVolumetricFlux.INCHES_PER_HOUR,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key=TYPE_HUMIDITY10,

View File

@ -184,8 +184,8 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="precipitation",
name="Precipitation",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
icon="mdi:weather-pouring",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key="irradiance",
@ -198,7 +198,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
key="precipitation_forecast_average",
name="Precipitation forecast average",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
icon="mdi:weather-pouring",
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SensorEntityDescription(
key="precipitation_forecast_total",

View File

@ -158,11 +158,13 @@ ECOWITT_SENSORS_MAPPING: Final = {
key="RAIN_RATE_MM",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
EcoWittSensorTypes.RAIN_RATE_INCHES: SensorEntityDescription(
key="RAIN_RATE_INCHES",
native_unit_of_measurement=UnitOfVolumetricFlux.INCHES_PER_HOUR,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
EcoWittSensorTypes.LIGHTNING_DISTANCE_KM: SensorEntityDescription(
key="LIGHTNING_DISTANCE_KM",

View File

@ -173,6 +173,7 @@ SENSOR_TYPES = (
name="Rain rate",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
RfxtrxSensorEntityDescription(
key="Sound",

View File

@ -58,8 +58,8 @@ SENSOR_TYPES: dict[str, SensorEntityDescription] = {
key=SENSOR_TYPE_RAINRATE,
name="Rain rate",
native_unit_of_measurement=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
icon="mdi:water",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
),
SENSOR_TYPE_RAINTOTAL: SensorEntityDescription(
key=SENSOR_TYPE_RAINTOTAL,