adafruit_dash_display

CircuitPython library for creating Adafruit IO dashboards.

  • Author(s): Dylan Herrada

Implementation Notes

Hardware:

  • This library currently only officially supports the Adafruit Funhouse but other boards are coming soon.

Software and Dependencies:

class adafruit_dash_display.Feed(key, default_text, formatted_text, callback, color, pub, index)

Feed object to make getting and setting different feed properties easier

property key

Getter for feed key. Will give the value of the feed key

property text

Getter for text ready to be formatted. Will give the feed text

property callback

Getter for callback function. Returns the feed callback

property color

Getter for text color callback function. Will return the color for the feed

property pub

Getter for publish function, called when a new value is published by this library.

property last_val

Getter for the last value received

class adafruit_dash_display.Hub(display, io, nav)

Object that lets you make an IOT dashboard

simple_text_callback(client, feed_id, message)

Default callback function that uses the text in the Feed object and the color callback to set the text

update_text(client, feed_id, message)

Updates the text on the display

base_pub(var)

Default function called when a feed is published to

add_device(feed_key, default_text=None, formatted_text=None, color_callback=None, callback=None, pub_method=None)

Adds a feed/device to the UI

get()

Gets all the subscribed feeds

static connected(client)

Callback for when the device is connected to Adafruit IO

static subscribe(client, userdata, topic, granted_qos)

Callback for when a new feed is subscribed to

static disconnected(client)

Callback for when the device disconnects from Adafruit IO

message(client, feed_id, message)

Callback for whenever a new message is received

publish(feed, message)

Callback for publishing a message

loop()

Loops Adafruit IO and also checks to see if any buttons have been pressed