Chill index fix

Fix chill index formula as suggested by @facko79.
Chill index is computed only for temperatures  less then 10°C (50°F). Otherwise real temperature is returned.
pull/27/head
schizza 2024-06-17 14:37:50 +02:00
parent 615b384487
commit fb9830cc1e
2 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,6 @@
"issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues", "issue_tracker": "https://github.com/schizza/SWS-12500-custom-component/issues",
"requirements": [], "requirements": [],
"ssdp": [], "ssdp": [],
"version": "0.1.3", "version": "0.1.3.4",
"zeroconf": [] "zeroconf": []
} }

View File

@ -201,7 +201,7 @@ def chill_index(data: Any) -> UnitOfTemperature:
temp = float(data[OUTSIDE_TEMP]) temp = float(data[OUTSIDE_TEMP])
wind = float(data[WIND_SPEED]) wind = float(data[WIND_SPEED])
return round( return round(
( (
(35.7 + (0.6215 * temp)) (35.7 + (0.6215 * temp))
@ -209,4 +209,4 @@ def chill_index(data: Any) -> UnitOfTemperature:
+ (0.4275 * (temp * (wind**0.16))) + (0.4275 * (temp * (wind**0.16)))
), ),
2, 2,
) ) if temp < 50 and wind > 3 else temp