v5.4.4-dev.4
Pre-release
Pre-release
Main new features in this dev release are:
- Add fire dom event to allow browser_mod integration. Thanks to @Izecube for this
- Use Home Assistant typescript modules for Icon colors. They should be the same as a result
- Add named variables section to allow Template/YAML def re-use by Templates
for example:
- type: custom:flex-horseshoe-card
entities:
- entity: sensor.dsmr_reading_electricity_currently_delivered
decimals: 2
name: 'All'
icon: |
[[[
const value = Number(state);
return value >= 0.4
? 'mdi:flash'
: 'mdi:flash-off';
]]]
variables:
flashAnimation: |
[[[
const value = Number(state);
return value >= 0.3
? 'flash 1s ease-in-out 3'
: 'none';
]]]
testColorStops: |
[[[
return {
0: 'black',
0.1: `[[[ return 'hotpink'; ]]]`,
0.5: 'yellow',
1: 'orange',
3: `[[[ return 'red'; ]]]`,
5: `[[[ return 'purple'; ]]]`,
};
]]]
testColorStops2: |
[[[
return {
0: 'blue',
0.1: 'green',
0.5: 'yellow',
1: 'orange',
3: 'red',
5: 'purple',
};
]]] and use them in the following ways:
Let the horsehoe flash
horseshoe_state:
width: 12
styles:
- animation: |
[[[
return variables['flashAnimation'];
]]]Re-use color stops for more than one object. For instance the horseshoe itself, but also an icon, or line.
color_stops: |
[[[ return variables['testColorStops3']; ]]]What's Changed
🚀 New features
- 157 experiment with generic template and dictlist features part 1 by @AmoebeLabs in #158
- Part 1: Add Templates, ConfigHelper and ColorStops normalizers by @AmoebeLabs in #161
- feat: Experiment with generic template and dictlist features by @AmoebeLabs in #165
- feat: Allow more than 1 horseshoe configured and displayed in 'horseshoes' section by @AmoebeLabs in #169
- feat: add icon domain stuff and localizations from home assistant by @AmoebeLabs in #173
- feat: Extend template engine with reusable variables and nesting by @AmoebeLabs in #175
- feat: revisit icon state colors once again by @AmoebeLabs in #177
- Add templates to entities configuration by @AmoebeLabs in #164
- feat: Add fire dom event to tap action from 78 by @AmoebeLabs in #179, original by @IzeQube in PR #78
🧰 Maintenance
- Revert pr for release by @AmoebeLabs in #160
- Restore part 1 changes by @AmoebeLabs in #163
Other changes
Full Changelog: v5.4.4...v5.4.4-dev.4