:noindex
Kervi values api¶
-
class
kervi.values.
BooleanValue
(name, **kwargs)¶ A value that holds a boolean. When linked to a dashboard it is represented as a switch button or push button.
-
link_to_dashboard
(dashboard_id=None, panel_id=None, **kwargs)¶ Links this value to a dashboard panel.
- Parameters
dashboard_id (str) – Id of the dashboard to link to.
panel_id (str) – Id of the panel on the dashboard to link to.
**kwargs – Use the kwargs below to override default values for ui parameters
- Keyword Arguments
link_to_header (
str
) – Link this value to the header of the panel.label_icon (
str
) – Icon that should be displayed together with label.label (
str
) – Label text, default value is the name of the value.flat (
bool
) – Flat look and feel.- inline (
bool
) – Display value and label in its actual size If you set inline to true the size parameter is ignored. The value will only occupy as much space as the label and input takes.
- inline (
input_size (
int
) – width of the slider as a percentage of the total container it sits in.value_size (
int
) – width of the value area as a percentage of the total container it sits in.type (
string
) – if value should be displayes as a ‘switch’ (default) or ‘push’ for push button.on_text (
string
) – Text to display when switch is on.off_text (
string
) – Text to display when switch is off.on_icon (
string
) – Icon to display when switch is on.off_icon (
string
) – Icon to display when switch is off.button_icon (
string
) – Icon to display on button.button_text (
string
) – Text to display on button, default is name.
-
-
class
kervi.values.
ColorValue
(name, **kwargs)¶ A value that holds a rgb value. When linked to a dashboard it is represented as a color button.
-
link_to_dashboard
(dashboard_id=None, panel_id=None, **kwargs)¶ Links this value to a dashboard panel.
- Parameters
dashboard_id (str) – Id of the dashboard to link to.
panel_id (str) – Id of the panel on the dashboard to link to.
**kwargs – Use the kwargs below to override default values for ui parameters
- Keyword Arguments
link_to_header (
str
) – Link this value to the header of the panel.label_icon (
str
) – Icon that should be displayed together with label.label (
str
) – Label text, default value is the name of the value.flat (
bool
) – Flat look and feel.- inline (
bool
) – Display value and label in its actual size If you set inline to true the size parameter is ignored. The value will only occupy as much space as the label and input takes.
- inline (
input_size (
int
) – width of the slider as a percentage of the total container it sits in.value_size (
int
) – width of the value area as a percentage of the total container it sits in.type (
string
) – ‘button’ or ‘input’.button_icon (
string
) – Icon to display on button.button_text (
string
) – Text to display on button, default is name.
-
property
rgb
¶ retuns the color value as rgb tuple
-
property
value
¶ Current value of the component
-
-
class
kervi.values.
DateTimeValue
(name, input_type='datetime', **kwargs)¶ A value that holds a date and/or time.
-
property
date
¶ Current value of the component
-
property
time
¶ Current value of the component
-
property
value
¶ Current value of the component
-
property
-
class
kervi.values.
EnumValue
(name, **kwargs)¶ A value that holds a selection of predefined values to select between. The value is presented as a dropdown on dashboards.
Usage:
self.framerate = self.inputs.add("frame_rate", "Frame rate", EnumSignal) self.framerate.addOption("5", "5 / sec") self.framerate.addOption("10", "10 / sec") self.framerate.addOption("15", "15 / sec", True)
-
add_option
(value, text, selected=False)¶ Add option to select
- Parameters
value – The value that the option represent.
text – The text that should be displayer in dropdown
selected – True if the option should be the default value.
-
-
class
kervi.values.
NumberValue
(name, **kwargs)¶ Value that holds a float value. If this value is an input it is shown as a slider on dashboards. If is an output it is possible to specify different kinds of gauges.
-
property
delta
¶ Enter how much a the value should change before it triggers changes events and updates links. :type:
float
-
property
display_unit
¶ Display unit of value.
- Type
str
-
link_to_dashboard
(dashboard_id=None, panel_id=None, **kwargs)¶ Links this value to a dashboard panel.
- Parameters
dashboard_id (str) – Id of the dashboard to link to.
panel_id (str) – Id of the panel on the dashboard to link to.
**kwargs – Use the kwargs below to override default values for ui parameters
- Keyword Arguments
link_to_header (
str
) – Link this value to the header of the panel.label_icon (
str
) – Icon that should be displayed together with label.label (
str
) – Label text, default value is the name of the value.flat (
bool
) – Flat look and feel.- inline (
bool
) – Display value and label in its actual size The value will only occupy as much space as the label and input takes.
- inline (
input_size (
int
) – width of the slider as a percentage of the total container it sits in.value_size (
int
) – width of the value area as a percentage of the total container it sits in.- type (
string
) – How to display the value on the panel. The possible display type values depends on the value type being input or output Input: ‘horizontal_slider’ (default) or ‘vertical_slider’. Output: ‘value’ (default), ‘chart’, ‘radial_gauge’, ‘horizontal_gauge’, ‘vertical_gauge’
- type (
- chart_buttons (
bool / str
) – False no chart buttons are shown. True chart buttons are shown at the bottom. “top” the chart buttons are shown above the chart.
- chart_buttons (
chart_grid (
bool
) – If true the value grid is displayed.chart_interval (
str
) – Initial time interval displayed.
possible values are “5min”, “15min”, “30min”, “hour” (default), “day”, “week”, “month”, “year”
-
property
max
¶ Maximum value.
- Type
float
-
property
min
¶ Minimum value.
- Type
float
-
property
type
¶ Value type.
- Type
str
-
property
-
class
kervi.values.
StringValue
(name, **kwargs)¶ Value that holds a string.
-
link_to_dashboard
(dashboard_id=None, panel_id=None, **kwargs)¶ Links this value to a dashboard panel.
- Parameters
dashboard_id (str) – Id of the dashboard to link to.
panel_id (str) – Id of the panel on the dashboard to link to.
**kwargs – Use the kwargs below to override default values for ui parameters
- Keyword Arguments
link_to_header (
str
) – Link this value to the header of the panel.label_icon (
str
) – Icon that should be displayed together with label.label (
str
) – Label text, default value is the name of the value.flat (
bool
) – Flat look and feel.- inline (
bool
) – Display value and label in its actual size The value will only occupy as much space as the label and input takes.
- inline (
input_size (
int | str
) – Width of the input field. Use px, % or rem as unit.value_size (
int
) – width of the value area as a percentage of the total container it sits in.
-