From b1cec2f38ff92f57dd8d04da1a9f1da64a3f3271 Mon Sep 17 00:00:00 2001 From: schizza Date: Fri, 4 Jul 2025 19:27:45 +0200 Subject: [PATCH] Adds CH3 temperature and humidity sensors Enables CH3 temperature and humidity sensors for WSLink devices. --- custom_components/sws12500/const.py | 2 ++ custom_components/sws12500/manifest.json | 2 +- custom_components/sws12500/sensors_wslink.py | 38 ++++++++++---------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/custom_components/sws12500/const.py b/custom_components/sws12500/const.py index 1819c7f..01a92d0 100644 --- a/custom_components/sws12500/const.py +++ b/custom_components/sws12500/const.py @@ -137,6 +137,8 @@ REMAP_WSLINK_ITEMS: dict = { "t1rainwy": WEEKLY_RAIN, "t1rainmth": MONTHLY_RAIN, "t1rainyr": YEARLY_RAIN, + "t234c2tem": CH3_TEMP, + "t234c2hum": CH3_HUMIDITY, } # TODO: Add more sensors diff --git a/custom_components/sws12500/manifest.json b/custom_components/sws12500/manifest.json index 56461c7..2d09c8f 100644 --- a/custom_components/sws12500/manifest.json +++ b/custom_components/sws12500/manifest.json @@ -10,6 +10,6 @@ "issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues", "requirements": [], "ssdp": [], - "version": "1.6.2", + "version": "1.6.5", "zeroconf": [] } diff --git a/custom_components/sws12500/sensors_wslink.py b/custom_components/sws12500/sensors_wslink.py index dc09aa9..5d512e2 100644 --- a/custom_components/sws12500/sensors_wslink.py +++ b/custom_components/sws12500/sensors_wslink.py @@ -243,25 +243,25 @@ SENSOR_TYPES_WSLINK: tuple[WeatherSensorEntityDescription, ...] = ( translation_key=CH2_HUMIDITY, value_fn=lambda data: cast("int", data), ), - # WeatherSensorEntityDescription( - # key=CH3_TEMP, - # native_unit_of_measurement=UnitOfTemperature.FAHRENHEIT, - # state_class=SensorStateClass.MEASUREMENT, - # device_class=SensorDeviceClass.TEMPERATURE, - # suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, - # icon="mdi:weather-sunny", - # translation_key=CH3_TEMP, - # value_fn=lambda data: cast(float, data), - # ), - # WeatherSensorEntityDescription( - # key=CH3_HUMIDITY, - # native_unit_of_measurement=PERCENTAGE, - # state_class=SensorStateClass.MEASUREMENT, - # device_class=SensorDeviceClass.HUMIDITY, - # icon="mdi:weather-sunny", - # translation_key=CH3_HUMIDITY, - # value_fn=lambda data: cast(int, data), - # ), + WeatherSensorEntityDescription( + key=CH3_TEMP, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.TEMPERATURE, + suggested_unit_of_measurement=UnitOfTemperature.CELSIUS, + icon="mdi:weather-sunny", + translation_key=CH3_TEMP, + value_fn=lambda data: cast(float, data), + ), + WeatherSensorEntityDescription( + key=CH3_HUMIDITY, + native_unit_of_measurement=PERCENTAGE, + state_class=SensorStateClass.MEASUREMENT, + device_class=SensorDeviceClass.HUMIDITY, + icon="mdi:weather-sunny", + translation_key=CH3_HUMIDITY, + value_fn=lambda data: cast(int, data), + ), # WeatherSensorEntityDescription( # key=CH4_TEMP, # native_unit_of_measurement=UnitOfTemperature.FAHRENHEIT,