Temperature

class knut.apis.Temperature

Interact with the temperature service.

This class extends the KnutAPI to handle the following requests:

The temperature back-ends accessed by this class are registered in the backends dictionary. They can be add using add_backend() which also connects the back-end’s on_change() event to the notifier() method.

add_backend(backend: knut.services.temperature.temperature.Temperature)None

Adds the backend to the backends dictionary.

backends = None

A dictionary with all back-ends where the keys are the unique names and the values are the corresponding temperature objects knut.services.temperature.Temperature.

notifier(uid: str)None

Pushes a TEMPERATURE_STATUS_RESPONSE for uid via the on_push() event.

status(uid: str)dict

Returns a status dictionary of the back-end specified by its uid.

The returned dictionary has the keys:

  • 'location' as string where the temperature is measured

  • 'unit' as string with the value K

  • 'condition' is a string with the code point for the Weather Icon font

  • 'temperature' as a float