silviokennecke / ha-custom-components

Custom components I use in my home assistant installation
GNU General Public License v3.0
7 stars 4 forks source link

Enhancement: Background Color depending on State #12

Open akwak2015 opened 4 months ago

akwak2015 commented 4 months ago

Hi, I like to have the possibility to change the background color or theme depending of the state of an train. I always use the same train to go to work. If it is canceled, I can use a train 15 minutes earlier but the next after will depart 45 minutes later. I like to see in the morning if my train is delayed or canceled. So I would prefere colors like green for ontime, yellow for delayed and red for canceled. Maybe I can realise this by changing the team on runtime, but I dont know where to define the themes.

silviokennecke commented 4 months ago

Currently this is done via CSS which can be found at the end of the connection.card.js. However, if I understood you correctly, this would also require some minor changes to add the appropriate classes to the elements, so the styling can be adjusted by state.

akwak2015 commented 4 months ago

Ok, I found the Themes in the connection.card.js. As you wrote, there have to be the ability to adjust the styling depend on the state of a special train. This is perhaps a very specific request and I can certainly solve it in other ways. I'm new to HA and have to try a lot ;-)

r100gs commented 2 months ago

Hello, this is not so special, because I would like to archive the same solution. THX, Stefan. I will try to modify