gadgetchnnel / lovelace-home-feed-card

A custom Lovelace card for displaying a combination of persistent notifications, calendar events, and entities in the style of a feed.
275 stars 24 forks source link

Format inline images to fit card #20

Closed jazzyisj closed 4 years ago

jazzyisj commented 4 years ago

Would it be possible to format inline images in a persistent notification feed item to a maximum size so they fit in the card? What I'm trying to do is use the snapshots from my security cams that are taken when the alarm is triggered in my home feed. The snapshots are rather large and as you can see only the top left corner shows in the screenshot below. The notification title is also not displaying.

image

There are actually 4 of these images in this particular notification. They don't fit into the actual persistent notification either so I had big hopes on how they would work in the lovelace home feed card!

       - service: persistent_notification.create
        data_template:
          title: Garage Motion Alert
          notification_id: garage_motion_alert
          message: |
            ![image](/local/capture/yadda.jpg)
            ![image](/local/capture/yadda2.jpg
            ![image](/local/capture/yadda3.jpg
            ![image](/local/capture/yadda4.jpg

I also don't know how much control you have over the size of the more_info box when it is clicked but if it's possible to limit that size also that would be great. Clicking on the image opens a huge window that is mostly off the screen.

BTW - this is an awesome card!

gadgetchnnel commented 4 years ago

Can you please try this in the latest Beta release 0.3.4b1, which should fix this. Edit: I've now released Beta version 0.3.4b2, which fixes an issue where images would be stretched if they are narrower than the feed.

jazzyisj commented 4 years ago

Looks like ya nailed it! Issue closed. Thanks for the quick response - this is very useful in my home feed! Now I have to convince the core developers to do the same for the native persistent notification display :-)

image