openhab-webui/bundles/org.openhab.ui/doc/components/oh-knob-card.md

228 lines
7.3 KiB
Markdown
Raw Normal View History

---
title: oh-knob-card - Knob Card
component: oh-knob-card
label: Knob Card
description: Display a knob in a card to visualize and control a quantifiable item
source: https://github.com/openhab/openhab-webui/edit/main/bundles/org.openhab.ui/doc/components/oh-knob-card.md
prev: /docs/ui/components/
---
# oh-knob-card - Knob Card
![](images/oh-knob/header.png)
[[toc]]
<!-- Note: you can overwrite the definition-provided description and add your own intro/additional sections instead -->
<!-- DO NOT REMOVE the following comments if you intend to keep the definition-provided description -->
<!-- GENERATED componentDescription -->
Display a knob in a card to visualize and control a quantifiable item
<!-- GENERATED /componentDescription -->
## Configuration
<!-- DO NOT REMOVE the following comments -->
<!-- GENERATED props -->
### Card
<div class="props">
<PropGroup name="card" label="Card">
Parameters of the card
<PropBlock type="TEXT" name="title" label="Title">
<PropDescription>
Title of the card
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="footer" label="Footer text">
<PropDescription>
Footer of the card
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="noBorder" label="No Border">
<PropDescription>
Do not render the card border
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="noShadow" label="No Shadow">
<PropDescription>
Do not render a shadow effect to the card
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="outline" label="Outline">
<PropDescription>
Show the card outline
</PropDescription>
</PropBlock>
</PropGroup>
</div>
2023-02-12 19:55:05 +00:00
### Knob & Round Slider
<div class="props">
2023-02-12 19:55:05 +00:00
<PropGroup name="knob" label="Knob & Round Slider">
Parameters are passed to the underlying <a target="_blank" class="external text-color-blue" href="https://github.com/kramer99/vue-knob-control#properties">knob control</a> or <a target="_blank" class="external text-color-blue" href="https://github.com/soundar24/vue-round-slider#props">round-slider control</a>
<PropBlock type="TEXT" name="item" label="Item" context="item">
<PropDescription>
Item to control
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="useSliderControl" label="Use Slider Control">
<PropDescription>
Use <a class="external text-color-blue" target="_blank" href="https://vue.roundsliderui.com/">round-slider control</a> instead of knob control (allows more customization) - parameters are advanced!
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="min" label="Min">
<PropDescription>
Minimum value (default 0)
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="max" label="Max">
<PropDescription>
Maximum value (default 100)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="circleShape" label="Circle Shape">
<PropDescription>
full, pie, half-top/-bottom/-left/-right, quarter-top-left/-right, quarter-bottom-left/-right - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="startAngle" label="Start Angle">
<PropDescription>
Angle of circle where the round slider should start (default 0); 0 is 9 o'clock; only if circleShape is not set - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="endAngle" label="End Angle">
<PropDescription>
Angle of circle where the round slider should start (default 360); 360 is 9 o'clock; only if circleShape is not set - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="DECIMAL" name="stepSize" label="Step">
<PropDescription>
Minimum interval between values (default 1)
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="disabled" label="Disabled">
<PropDescription>
Disable the slider (usually set via an expression since the value will not be displayed when disabled)
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="size" label="Size">
<PropDescription>
Visual size of the control in px (or % if responsive is true)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="primaryColor" label="Primary Color">
<PropDescription>
Color of the value arc (HTML value, default #409eff)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="secondaryColor" label="Secondary Color">
<PropDescription>
Color of the rest of the control (HTML value, default #dcdfe6)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="textColor" label="Text Color">
<PropDescription>
Color of the value text (HTML value, default #000000)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="borderColor" label="Border Color">
<PropDescription>
Sets the border color of the slider. By default it will inherit the primaryColor value (HTML value, default #000000) - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="borderWidth" label="Border Width">
<PropDescription>
Indicates the border width of the slider - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="strokeWidth" label="Stroke Width">
<PropDescription>
Thickness of the arcs (default 17)
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="lineCap" label="Line End Type">
<PropDescription>
butt, round, square, none - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="TEXT" name="dottedPath" label="Dotted Path">
<PropDescription>
Length of dotted path segments (css stroke-dasharray) - slider control only!
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="responsive" label="Responsive">
<PropDescription>
Size the control using percentages instead of pixels
</PropDescription>
</PropBlock>
<PropBlock type="BOOLEAN" name="releaseOnly" label="Send command only on release">
<PropDescription>
If enabled, no commands are sent during sliding
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="commandInterval" label="Command Interval">
<PropDescription>
Time to wait between subsequent commands in ms (default 200)
</PropDescription>
</PropBlock>
<PropBlock type="INTEGER" name="delayStateDisplay" label="Delay State Display">
<PropDescription>
Time to wait before switching from displaying user input to displaying item state in ms (default 2000)
</PropDescription>
</PropBlock>
</PropGroup>
</div>
<!-- GENERATED /props -->
<!-- If applicable describe how properties are forwarded to a underlying component from Framework7, ECharts, etc.:
### Inherited Properties
-->
<!-- If applicable describe the slots recognized by the component and what they represent:
### Slots
#### `default`
The contents of the oh-knob-card.
-->
<!-- Add as many examples as desired - put the YAML in a details container when it becomes too long (~150/200+ lines):
## Examples
### Example 1
![](./images/oh-knob-card/example1.jpg)
```yaml
component: oh-knob-card
config:
prop1: value1
prop2: value2
```
### Example 2
![](./images/oh-knob-card/example2.jpg)
::: details YAML
```yaml
component: oh-knob-card
config:
prop1: value1
prop2: value2
slots
```
:::
-->
<!-- Try to clean up URLs to the forum (https://community.openhab.org/t/<threadID>[/<postID>] should suffice)
## Community Resources
- [Community Post 1](https://community.openhab.org/t/12345)
- [Community Post 2](https://community.openhab.org/t/23456)
-->