mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Added documentation for gauge segments feature (#22479)
Co-authored-by: Zack Barett <zackbarett@hey.com>
This commit is contained in:
parent
8dd6a4a680
commit
d9a2be4093
@ -81,6 +81,19 @@ severity:
|
|||||||
required: true
|
required: true
|
||||||
description: Value from which to start red color.
|
description: Value from which to start red color.
|
||||||
type: integer
|
type: integer
|
||||||
|
segments:
|
||||||
|
required: false
|
||||||
|
description: List of colors and their corresponding start values. Segments will override the severity settings.
|
||||||
|
type: list
|
||||||
|
keys:
|
||||||
|
from:
|
||||||
|
required: true
|
||||||
|
description: Value from which to start the color.
|
||||||
|
type: integer
|
||||||
|
color:
|
||||||
|
required: true
|
||||||
|
description: Color of the segment, may be any CSS color declaration like "red", "#0000FF" or "rgb(255, 120, 0)".
|
||||||
|
type: string
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
@ -111,3 +124,29 @@ severity:
|
|||||||
yellow: 45
|
yellow: 45
|
||||||
red: 85
|
red: 85
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Multiple segments:
|
||||||
|
|
||||||
|
<p class='img'>
|
||||||
|
<img src='/images/dashboards/lovelace_gauge_segments.png' alt='Screenshot of the gauge card with multiple colored segments.'>
|
||||||
|
Screenshot of the gauge card with multiple colored segments.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
type: gauge
|
||||||
|
entity: sensor.kitchen_humidity
|
||||||
|
needle: true
|
||||||
|
min: 20
|
||||||
|
max: 80
|
||||||
|
segments:
|
||||||
|
- from: 0
|
||||||
|
color: '#db4437'
|
||||||
|
- from: 35
|
||||||
|
color: '#ffa600'
|
||||||
|
- from: 40
|
||||||
|
color: '#43a047'
|
||||||
|
- from: 60
|
||||||
|
color: '#ffa600'
|
||||||
|
- from: 65
|
||||||
|
color: '#db4437'
|
||||||
|
```
|
||||||
|
BIN
source/images/dashboards/lovelace_gauge_segments.png
Normal file
BIN
source/images/dashboards/lovelace_gauge_segments.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user