1 """Helper class for the Ambient Weather Network integration."""
3 from __future__
import annotations
18 """Pick a station name.
20 Station names can be empty, in which case we construct the name from
21 the location and device type.
23 if name := station.get(API_STATION_INFO, {}).
get(API_STATION_NAME):
26 station.get(API_STATION_INFO, {})
27 .
get(API_STATION_COORDS, {})
28 .
get(API_STATION_LOCATION)
30 station_type = station.get(API_LAST_DATA, {}).
get(API_STATION_TYPE)
31 return f
"{location}{'' if location is None or station_type is None else ' '}{station_type}"
str get_station_name(dict[str, Any] station)
web.Response get(self, web.Request request, str config_key)