-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SHARE YOUR FORMATTER - your modify:
line everybody should have!
#75
Comments
modify:
line you cannot live with...modify:
line
modify:
linemodify:
line everybody should have!
A simple table which shows if core/ os/ supervisor/ addon updates are available (including, via HACS). type: custom:flex-table-card
sort_by:
- state+
- friendly_name+
entities:
include:
- update.*
- sensor.hacs
columns:
- name: Name
data: friendly_name
modify: x.split(":")[0];
- name: Update
data: state
modify: x.replace("on", "Yes"),x.replace("off", "No") Result looks like this: I would like to modify it so that the state can also replace 0 (from HACS) with "No" but it looks like modify only allows 2 modifiers for now. Would also like to modify it so that rows with update other than No are highlighted but this cannot be done currently. |
I too would like to highlight rows based on content, as for your states would - name: Update
data: state
modify: ( x == 1 || x == "on" ? '<div style="color:yellow;">Yes</div>' :"No") work for you? edited: to add colour to the text :) Highlight the cell text "Yes" in yellow. Carl |
UPDATE: I put a separate ticket for this: #85 |
How to get a date in a format "DD/MM/YYYY hh:mm:ss" from a timestamp value:
|
How to draw batteries:
|
Here's one I'm using with Environment Canada integration for a daily forecast:
|
Using the Anniversaries (https://github.com/pinkywafer/Anniversaries) integration for a list of birthdays ... This gives name, birthdate (month and day), current age, and days until their next birthday.
|
If I am not mistaken the second x.replace should be simply attached to the first like So replace the |
Just today the
fmt
property was introduces and even 2 lines documentation made it into the repository, BUT there is just an shameful small amount of formatters available. Now it's your turn, share your favoritemodify:
lines, or even better, directly put them into the right spot and make a pull-request - but if course, feel also free to share yours inside this issue:flex-table-card/flex-table-card.js
Lines 53 to 75 in 52ca1b7
The text was updated successfully, but these errors were encountered: