Widget Context¶
An instance of the WidgetContext is passed to each
widget when the widget is loaded.
-
class
dashboard.widget_context.WidgetContext(resolver=None, settings=None)[source]¶ Context that is passed as an argument to widgets when they are called.
The context contains methods useful for widgets.
-
client¶ A
uvhttp.http.Sessionthat can be used for making HTTP requests:async def ip_widget(wc): response = await wc.client.get(b'http://httpbin.org/ip') return { "ip": response.json()["origin"] }
-
hue¶ The
uvhue.uvhue.Hueclient that can be used by widgets.
-
sonos¶ The
dashboard.sonos.Sonosclient that can be used by widgets.
-