From d1db70eac13e922b9ac8b19e39db6bfb33493e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85ke=20Strandberg?= Date: Thu, 14 Dec 2023 15:18:36 +0000 Subject: [PATCH] Get correct values for gusts --- custom_components/weatherlink/__init__.py | 4 +++- custom_components/weatherlink/sensor.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/weatherlink/__init__.py b/custom_components/weatherlink/__init__.py index eac6d1e..34eee2f 100644 --- a/custom_components/weatherlink/__init__.py +++ b/custom_components/weatherlink/__init__.py @@ -124,7 +124,9 @@ def _preprocess(indata: str): outdata[DataKey.HUM_OUT] = indata.get("relative_humidity") outdata[DataKey.BAR_SEA_LEVEL] = indata.get("pressure_in") outdata[DataKey.WIND_MPH] = indata.get("wind_mph") - outdata[DataKey.WIND_GUST_MPH] = indata.get("wind_gust_mph") + outdata[DataKey.WIND_GUST_MPH] = indata["davis_current_observation"].get( + "wind_ten_min_gust_mph" + ) outdata[DataKey.WIND_DIR] = indata.get("wind_degrees") outdata[DataKey.DEWPOINT] = indata.get("dewpoint_f") outdata[DataKey.RAIN_DAY] = indata["davis_current_observation"].get( diff --git a/custom_components/weatherlink/sensor.py b/custom_components/weatherlink/sensor.py index 4fb4b9a..5687a73 100644 --- a/custom_components/weatherlink/sensor.py +++ b/custom_components/weatherlink/sensor.py @@ -107,7 +107,7 @@ class WLSensorDescription(SensorEntityDescription): ), WLSensorDescription( key="WindGust", - tag=DataKey.WIND_MPH, + tag=DataKey.WIND_GUST_MPH, device_class=SensorDeviceClass.WIND_SPEED, translation_key="wind_gust", suggested_display_precision=1,