def bom_stations(cache_dir):
    'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n    Results from internet requests are cached as compressed JSON, making\n    subsequent calls very much faster.\n    '
    cache_file = os.path.join(cache_dir, '.bom-stations.json.gz')
    if (not os.path.isfile(cache_file)):
        stations = _get_bom_stations()
        with gzip.open(cache_file, 'wt') as cache:
            json.dump(stations, cache, sort_keys=True)
        return stations
    with gzip.open(cache_file, 'rt') as cache:
        return {k: tuple(v) for (k, v) in json.load(cache).items()}
Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.

Results from internet requests are cached as compressed JSON, making
subsequent calls very much faster.
def bom_stations(cache_dir):
    'Return {CONF_STATION: (lat, lon)} for all stations, for auto-config.\n\n    Results from internet requests are cached as compressed JSON, making\n    subsequent calls very much faster.\n    '
    cache_file = os.path.join(cache_dir, '.bom-stations.json.gz')
    if (not os.path.isfile(cache_file)):
        stations = _get_bom_stations()
        with gzip.open(cache_file, 'wt') as cache:
            json.dump(stations, cache, sort_keys=True)
        return stations
    with gzip.open(cache_file, 'rt') as cache:
        return {k: tuple(v) for (k, v) in json.load(cache).items()}