Display api

The display module holds classes for handling displays.

class kervi.displays.Display(display_id, name, device_driver)

The display class manage a display device.

Parameters
  • display_id (str) – Id of the display. This id is never displayed it is used to reference the display in code.

  • name (str) – Name of the display.

  • device (DisplayDeviceDriver) – The display device that should be used. Could be one of the displays from the kervi device library or a display device driver that inherits from kervi.hal.DisplayDeviceDriver

activate_page(page_id)

Activates a display page. Content of the active page is shown in the display.

Parameters

page_id (str) – Id of page to activate

property active_page

The current active display page or None if no pages are added.

add_page(page, default=True)

Add a display page to the display.

Parameters
  • page – Page to be added

  • default – True if this page should be shown upon initialization.

controller_exit()

Abstract method that is called when the kervi application stops.

controller_start()

Abstract method that is called when the entire application is loaded.

property display_pages

Returns the display pages added to this display

input_changed(changed_input)

Abstract method that is called by when one of the controller inputs change.

You can implement this method if your controller logic needs to respond changes in multiple inputs.

Parameters

changed_input (KerviValue) – Input that has changed. You can read the value of the changed input via the inputs value property.

class kervi.displays.DisplayPage(page_id, name=None)
input_changed(value)

Abstract method that is called by when one of the controller inputs change.

You can implement this method if your controller logic needs to respond changes in multiple inputs.

Parameters

changed_input (KerviValue) – Input that has changed. You can read the value of the changed input via the inputs value property.