SWS-12500-custom-component/custom_components/sws12500
SchiZzA 0e5a8ce10c
fix(wslink): compute heat and wind chill index when the station omits them
The WU/PWS platform derives both indices from temperature, humidity and wind
(value_from_data_fn=heat_index / chill_index), but the WSLink descriptions only
read the station's own t1heat / t1chill via value_fn=to_float. Stations that do
not report those fields still got both entities, because
_auto_enable_derived_sensors creates them as soon as the raw inputs arrive, so
they stayed Unavailable forever.

Add wslink_heat_index / wslink_chill_index: prefer the station's reading, compute
it otherwise. The conversions are the subtle part. The WSLink payload is metric
and both entities are declared in Celsius, while the NWS formulas are defined for
Fahrenheit, and chill_index converts the temperature but not the wind speed even
though its formula needs mph. So the temperature goes C -> F in, the wind m/s ->
mph, and the result F -> C back out. For the reported payload (6.2 C, 40 %,
30.6 m/s) that is -1.94 C; leaving the wind in m/s would have reported 0.34 C.

The native unit stays Celsius on purpose: switching it to Fahrenheit to match the
WU platform would misread the values of stations that do send t1heat / t1chill.

Also guard on missing temperature/humidity/wind before delegating, so a payload
without those fields no longer logs an error on every push.
2026-07-26 01:20:56 +02:00
..
translations no-mistakes(review): Migrate Pocasi option key, fix typos and Windy status 2026-07-25 22:12:55 +02:00
__init__.py no-mistakes(review): Migrate Pocasi option key, fix typos and Windy status 2026-07-25 22:12:55 +02:00
battery_sensors.py feat(device): merge all entities into one shared device with station-type model 2026-07-25 21:47:53 +02:00
battery_sensors_def.py refactor(sws12500): centralize battery sensor classification 2026-07-25 23:24:45 +02:00
binary_sensor.py fix(correctness): reload-window guards, rate-limit races, ecowitt flush, dt_util 2026-07-25 21:47:52 +02:00
config_flow.py fix(sws12500): harden credential validation, URL fallback and push timeouts 2026-07-26 00:39:15 +02:00
conflicts.py fix: block enabling legacy and Ecowitt protocols together 2026-07-25 21:47:53 +02:00
const.py refactor(sws12500): centralize battery sensor classification 2026-07-25 23:24:45 +02:00
coordinator.py fix: address remaining review findings across forwarders and utils 2026-07-25 21:47:54 +02:00
data.py fix: block enabling legacy and Ecowitt protocols together 2026-07-25 21:47:53 +02:00
diagnostics.py fix(security)+i18n: stop health-attribute leak, mask secrets in logs, sync translations 2026-07-25 21:47:52 +02:00
ecowitt.py fix: address remaining review findings across forwarders and utils 2026-07-25 21:47:54 +02:00
health_coordinator.py fix: address remaining review findings across forwarders and utils 2026-07-25 21:47:54 +02:00
health_sensor.py feat(device): merge all entities into one shared device with station-type model 2026-07-25 21:47:53 +02:00
icons.json Refactor SWS12500 integration for push-based updates 2026-07-25 21:45:07 +02:00
legacy.py fix: address remaining review findings across forwarders and utils 2026-07-25 21:47:54 +02:00
manifest.json chore(quality): manifest keys, ConfigEntryNotReady, remove dead sqlite code 2026-07-25 21:47:52 +02:00
pocasti_cz.py fix(sws12500): harden credential validation, URL fallback and push timeouts 2026-07-26 00:39:15 +02:00
routes.py fix: address remaining review findings across forwarders and utils 2026-07-25 21:47:54 +02:00
sensor.py feat(device): merge all entities into one shared device with station-type model 2026-07-25 21:47:53 +02:00
sensors_common.py fix: coordinator reuse, route dispatcher, binary sensor translations & test suite alignment 2026-07-25 21:47:50 +02:00
sensors_weather.py fix: address review findings across forwarders and helpers 2026-07-25 21:47:51 +02:00
sensors_wslink.py fix(wslink): compute heat and wind chill index when the station omits them 2026-07-26 01:20:56 +02:00
staleness.py Add stall sensor detection. 2026-07-25 21:47:50 +02:00
strings.json no-mistakes(review): Migrate Pocasi option key, fix typos and Windy status 2026-07-25 22:12:55 +02:00
sws12500 Add health diagnostic sensor and extensive tests for sws12500 2026-07-25 21:45:08 +02:00
utils.py fix(wslink): compute heat and wind chill index when the station omits them 2026-07-26 01:20:56 +02:00
windy_func.py fix(sws12500): harden credential validation, URL fallback and push timeouts 2026-07-26 00:39:15 +02:00