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

View File

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

View File

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

View File

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

View File

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

View File

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