Dashboards api

A dashboard is the main ui component in a kervi application.

class kervi.dashboards.Dashboard(dashboard_id, name, panels=None, **kwargs)

Create a UI dashboard. The dashboard will show up in the dashboard menu in the UI.

A dashboard contains one or more panels. Kervi components like sensors, controller inputs and other dynamic values are able to link to a panel on a dashboard.

All dashboard have the following system defined panels:
  • header_right

  • header_center

  • footer_left

  • footer_center

  • footer_right

Besides from these panels each dashboard has two controller pad areas where it is possible to link to the x and y coordinates of the pads. A dynamic value like controller input may link to one of the following panels:

  • left_pad_x

  • left_pad_y

  • right_pad_x

  • right_pad_y

Parameters
  • dashboard_id (str) – Unique id of the dashboard. Used when referencing this dashboard.

  • name (str) – Name of the dahsboard. Used when this dashboard is listed in the dashboard menu in the UI.

  • **kwargs – See below

Keyword Arguments
  • is_default (bool) –

    If true this dashboard will show up as the active dashboard when web dashboards loads.

add_panel(panel)

Add a dashboard panel to the dashboard

Parameters

panel (DashboardPanel) – A DashboardPanel to add to this dashboard.

class kervi.dashboards.DashboardPanel(panel_id, **kwargs)

Create a dashboard panel.

Parameters
  • panel_id (str) – id of the panel. This id is used in other components to reference this panel.

  • **kwargs – See below

Keyword Arguments
  • title (str) – Title of the panel.

  • columns (int) – Number of columns in this panel, default is 1.

  • rows (int) – Number of rows in this panel, default is 1.

  • user_log (bool) – This panel shows user log messages. Any components that are linked to a user log panel are ignored.

  • collapsed (bool) – If true the body of the panel is collapsed.

class kervi.dashboards.DashboardPanelGroup(panels=None, **kwargs)

Create a group of dashboard panels.

Parameters
  • group_id (str) – id of the group.

  • **kwargs – See below

Keyword Arguments
  • title (str) – Title of the group.

  • columns (int) – Number of columns in this group, default is 1.

  • rows (int) – Number of rows in this panel, default is 1.

  • user_log (bool) – This panel shows user log messages. Any components that are linked to a user log panel are ignored.

  • collapsed (bool) – If true the body of the panel is collapsed.