OpenWeatherMap

class knut.services.temperature.openweathermap.OpenWeatherMap(location: str, uid: str, appid: str)

OpenWeatherMap temperature service.

Extend the Temperature base class to provide a temperature service which connects to OpenWeatherMap’s API.

Connect to OpenWeatherMap’s API to get the weather information for the location. The unique id uid is used within Knut. To connect to the API, an appid is required. For more information regarding the appid read OpenWeatherMap’s guide.

daemon(s: int = 60)None

Request every s seconds new weather data.

If the data changed, the on_change() event is called.

data_logger()

Save every hour the temperature history.

request_data()

Send a HTTP request to the OpenWeatherMap API.