Fix range icon example (#2706)

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Abílio Costa <abmantis@users.noreply.github.com>
This commit is contained in:
Robert Resch 2025-06-23 10:10:10 +02:00 committed by GitHub
parent b6880e1e73
commit 6829d0a280
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ In the `icons.json` file, define the ranges and their corresponding icons in asc
"entity": { "entity": {
"sensor": { "sensor": {
"battery_level": { "battery_level": {
"default": "mdi:battery", "default": "mdi:battery-unknown",
"range": { "range": {
"0": "mdi:battery-outline", "0": "mdi:battery-outline",
"10": "mdi:battery-10", "10": "mdi:battery-10",
@ -103,8 +103,8 @@ The system selects the icon associated with the highest range value that's less
- A value of 45 will show the `mdi:battery-40` icon (45 is greater than 40 but less than 50) - A value of 45 will show the `mdi:battery-40` icon (45 is greater than 40 but less than 50)
- A value of 100 will show the `mdi:battery` icon (100 equals the highest defined range) - A value of 100 will show the `mdi:battery` icon (100 equals the highest defined range)
- A value of 5 will show the `mdi:battery-outline` icon (5 is greater than 0 but less than 10) - A value of 5 will show the `mdi:battery-outline` icon (5 is greater than 0 but less than 10)
- A value of -10 will show the `mdi:battery` default icon (value is outside defined ranges) - A value of -10 will show the `mdi:battery-unknown` default icon (value is outside defined ranges)
- A value of 120 will show the `mdi:battery` default icon (value exceeds all defined ranges) - A value of 120 will show the `mdi:battery` icon (any value exceeding the last defined range entry, 100, will use the icon associated with that final range value)
When implementing range-based icons: When implementing range-based icons: