dashboard ========= .. py:module:: dashboard .. autoapi-nested-parse:: Dashboard updates: full screen with new data, or only the header. Functions --------- .. autoapisummary:: dashboard.fetch_alerts dashboard.fetch dashboard.refresh_full dashboard.refresh_header Module Contents --------------- .. py:function:: fetch_alerts(source, ids) Active alerts, most severe first; none if the source fails. .. py:function:: fetch(source, cached_readings, log=None) Read the data source, falling back to cached readings. :param source: A data source (see `datasource`). :param cached_readings: Readings of the last successful fetch, or None. :param log: Optional callable for the reason when the source fails. :returns: fresh readings and True, or the cached ones (or none) and False if the source cannot be reached. :rtype: `(readings, online)` .. py:function:: refresh_full(epd, fb, buffer, readings, tiles, header, link=None, notice=None, active_alerts=None, partial=False, old=None, power_off=False) Draw the whole screen and show it on the display. :param epd: The display driver. :param fb: Framebuffer to draw into. :param buffer: The bytes behind `fb`. :param readings: What the data source returned. :param tiles: Tiles in the form of `tiles.to_layout`. :param header: Header dict (see `header`). :param link: URL to show as QR code, see `layout.render`. :param notice: Warning lines for the bottom-left tile. :param active_alerts: Warnings that replace the tiles. :param partial: Refresh without flashing instead of a full refresh (which flashes but clears ghosting). :param old: The image on the panel if the controller lost it. :param power_off: Switch the display off afterwards instead of sleeping. .. py:function:: refresh_header(epd, make_band, old, new, screen=None, power_off=False) Partial refresh of the header band from header `old` to `new`. `make_band()` returns a fresh (framebuf, buffer) pair of hdr.WIDTH x hdr.HEIGHT pixels. With `screen` (the whole image on a panel whose controller lost it) the whole screen is refreshed with the new band patched in, and the new image is returned. Returns False if nothing changed.