- def load(cls) -> Any:
- if persistent.was_file_written_within_n_seconds(
- config.config['weather_forecast_cachefile'],
- config.config['weather_forecast_stalest_acceptable'].total_seconds(),
- ):
- import pickle
-
- with open(config.config['weather_forecast_cachefile'], 'rb') as rf:
- weather_data = pickle.load(rf)
- return cls(weather_data)
- return None