Skip to content

v5.4.7-dev.12

Pre-release
Pre-release

Choose a tag to compare

@AmoebeLabs AmoebeLabs released this 23 Jun 12:44
b8a2c58

It is too hot for documentation, so I got creative again 😄

Let the horseshoe handle so-called stringstates, i.e., non-numerical states in two ways: states that show a level, and states that show a mode. Also included is dedicated formatting, depending on the segment/state, so fonts look nice, and you can use a different font for the active segment, and other segments (states).

Here you see a pollen card, using the stringstate_level mode and different font colors/modes for several segments.

image

A variation of the horseshoe in stringstate_mode mode: only the current state segment is filled.

image

Another variation with labels on its own arc using stringstate)level mode:

image

And one with stringstate_mode mode.
image

To give you an idea of the config:

                show:
                  horseshoe_style: colorstop
                  scale_style: colorstop
                  labels_at: stringstate      # So labels are nicely aligned in the middle of the segment

                horseshoe_state:
                  mode: stringstate_mode      # Single state active
                  width: 33
                  linecap: butt
                  state_map:                  # Need statemap for color stops and state translations
                    map:
                      - state: 'low'          # Raw states are translated
                        value: 0.99           # using Home Assistant
                      - state: 'moderate'     # and used as labels
                        value: 1.99
                      - state: 'high'
                        value: 2.99
                      - state: 'very_high'
                        value: 3.99
                  styles:
                    - stroke-linecap: butt
                #
                color_stops:
                  gap: 2
                  colors:
                    0: '#838383'
                    1: '#fcc449'
                    2: '#ed8003'
                    3: 'red'

And if you want, full control over label styling per segment (in the case you put the labels on the horseshoe state part) as you can see on card 54v2:

                horseshoe_labels:
                  orientation: arc
                  offset: 0      # Labels on horseshoe state
                  stringstate:
                    segment_roles:    # Specific label formatting per segment
                      before:
                        styles:
                          - opacity: 0.6
                      current:
                        styles:
                          - fill: white
                          - font-weight: bold
                      after:
                        styles:
                          - opacity: 0.35
                    state_map:      # Specific label formatting per state. Overrules segment formatting
                      map:
                        - state: very_high
                          label: Zeer Hoog    # Override label, as no translation available in Home Assistant
                          styles:
                            - fill: white                    
                        - state: high
                          styles:
                            - fill: white                    
                        - state: moderate
                          styles:
                            - fill: black  

What's Changed

🐛 Bug fixes

  • fix: Add future formatters as comment in state tool by @AmoebeLabs in #248
  • fix: Remove default 0 for entity index for shapes and icons if icon set by @AmoebeLabs in #256

🚀 New features

  • feat: (beta) Add labels and ticks to horseshoe by @AmoebeLabs in #212
  • feat: Add external json color palettes to support darklight mode for custom colors not in the theme by @AmoebeLabs in #214
  • feat: Extend same_as with named tags, and auto-ids when not assigned based on index in list, delta's and calc() functions by @AmoebeLabs in #218
  • feat: Add static constants and ref support for reusable layout configuration by @AmoebeLabs in #221
  • feat: Add display svg or image instead of icon by @AmoebeLabs in #225
  • feat: Add state mapping support to horseshoe by @AmoebeLabs in #226
  • feat: Add format options in entity definitions to regain control over formatting by @AmoebeLabs in #232
  • Refactor: Rewrite horseshoe to separate classes to make maintenance and changes easier by @AmoebeLabs in #234
  • feat: Add rectangle tool and base tool. Base tool to be used by future shap… by @AmoebeLabs in #238
  • feat: Add default ZPOS in config for each section by @AmoebeLabs in #252
  • feat: Add sorted zpos rendering by @AmoebeLabs in #253
  • feat: Add zpos next to xpos and ypos to define the layer and render order by @AmoebeLabs in #254
  • feat: Add parent tree to groups so groups itself can be grouped and positioned too. Includes dzpos and calc(zpos.
    ) by @AmoebeLabs in #257
  • feat: Add arc tool shape as lowest layer by @AmoebeLabs in #259
  • feat: Add segment stringstate mode for horseshoe to show for instance lowhighmoderate including labels and translations by @AmoebeLabs in #263

🧰 Maintenance

  • chore: Remove vx versions of functions and classes for dev3 by @AmoebeLabs in #216
  • chore: Remove obsolete files and fix regression for spline by @AmoebeLabs in #237
  • Bump js-yaml from 4.1.1 to 4.2.0 by @dependabot[bot] in #235

📚 Documentation

Other changes

  • refactor: Refactor other shapes like lines and circles to same structure as the rectangle by @AmoebeLabs in #240
  • Refactor: Add name and area too caused by refactor by @AmoebeLabs in #242
  • Refactor: Add state tool caused by refactor by @AmoebeLabs in #244
  • Refactor: Add icon tool caused by refactor by @AmoebeLabs in #246
  • refactor: Horseshoe-gauge now uses base tool by @AmoebeLabs in #261

Full Changelog: v5.4.7...v5.4.7-dev.12