From 0ab5321170478c3901ef299cec39c3eed33bca81 Mon Sep 17 00:00:00 2001 From: schizza Date: Sun, 13 Apr 2025 17:52:58 +0200 Subject: [PATCH] Corrects translation keys for rain sensors Updates the translation keys for hourly, weekly, monthly, and yearly rain sensors to ensure they accurately reflect the corresponding time periods. --- custom_components/sws12500/sensors_wslink.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/sws12500/sensors_wslink.py b/custom_components/sws12500/sensors_wslink.py index 8afd15c..dc09aa9 100644 --- a/custom_components/sws12500/sensors_wslink.py +++ b/custom_components/sws12500/sensors_wslink.py @@ -170,7 +170,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = ( suggested_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, suggested_display_precision=2, icon="mdi:weather-pouring", - translation_key=DAILY_RAIN, + translation_key=HOURLY_RAIN, value_fn=lambda data: cast("float", data), ), WeatherSensorEntityDescription( @@ -181,7 +181,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = ( suggested_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, suggested_display_precision=2, icon="mdi:weather-pouring", - translation_key=DAILY_RAIN, + translation_key=WEEKLY_RAIN, value_fn=lambda data: cast("float", data), ), WeatherSensorEntityDescription( @@ -192,7 +192,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = ( suggested_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, suggested_display_precision=2, icon="mdi:weather-pouring", - translation_key=DAILY_RAIN, + translation_key=MONTHLY_RAIN, value_fn=lambda data: cast("float", data), ), WeatherSensorEntityDescription( @@ -203,7 +203,7 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = ( suggested_unit_of_measurement=UnitOfPrecipitationDepth.MILLIMETERS, suggested_display_precision=2, icon="mdi:weather-pouring", - translation_key=DAILY_RAIN, + translation_key=YEARLY_RAIN, value_fn=lambda data: cast("float", data), ), WeatherSensorEntityDescription(