Rudd-O / homeassistant-meteoswiss

:sun_behind_rain_cloud: :switzerland: Meteo Swiss Integration for Home Assistant (forked from websylv)
92 stars 11 forks source link

During setup, sort real-time weather stations by adding the three closest ones first #51

Open Rudd-O opened 3 months ago

Rudd-O commented 3 months ago

During setup, we show a list of No station, then the default selected is the closest station, then we sort alphabetically.

This doesn't make much sense, since we should be offering the user the three closest stations (with the closest station preselected) when we show the form to the user, and then the rest in alphabetical order (with No station being first, always).

We do offer the choice of station this because sometimes the closest station is like 2 KM above the elevation of the user, which would give the user terrible, inaccurate data for his location. Accordingly, to facilitate this for the user, we should show the three closest stations right under his mouse when he clicks the dropdown.

Perhaps we should also show the distance of the station to the user in the same screen, to aid in selection.

This may require changes in hamsclientfork to provide for topological distance sorting of the entities as returned by its get all stations call.

davidemarcoli commented 6 days ago

This seems to be implemented by this integration: https://github.com/izacus/hass-swissweather/blob/master/custom_components/swissweather/config_flow.py#L57-L64