A Kervi controller is a class that acts upon input from users or events or the underlaying os.
Controller(controller_id, name, **kwargs)¶
A Kervi controller is a class that acts upon input from users, hardware events or the underlaying os.
Examples for controllers are motor control, servo control, output to IO.
A controller my define one or more dynamic values as input and output.
Abstract method that is called when the kervi application stops.
Abstract method that is called when the entire application is loaded.
Turn class into a kervi controller
input(input_id, name, value_class=<class 'kervi.values.NumberValue'>)¶
Add input to controller
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.
changed_input (KerviValue) – Input that has changed. You can read the value of the changed input via the inputs value property.
Links this component to a dashboard section all input are displayed.
dashboard_id – id of the dashboard to link to.
panel_id (str) – id of the section.
**kwargs – Use the kwargs below to override default values set in ui_parameters
- Keyword Arguments
- ui_size (
int) – Size of the component in dashboard unit size.
In order to make the sections and components align correct a dashboard unit is defined. Default the dashboard unit is a square that is 150 x 150 pixels. The width of the select box is ui_size * dashboard unit size.
- ui_size (
str) – Type of select box, dropdown or list.
str) – Add this component to header of section.
str) – Icon that should be displayed together with label.
bool) – Flat look and feel.
output(output_id, name, value_class=<class 'kervi.values.NumberValue'>)¶
Add output to controller