lubeda / EspHoMaTriXv2

A simple DIY status display with a 8x32 RGB LED matrix, implemented with esphome.io and Home Assistant.
MIT License
276 stars 25 forks source link

2023.9.1: Vertical scroll of screen #159

Closed andrewjswan closed 9 months ago

andrewjswan commented 9 months ago

Adds the ability to enable screen switching using vertical scrolling.

 ehmtxv2:
  id: rgb8x32
...
  vertical_scroll: true
...
chertvl commented 9 months ago

Looks great, thanks! Such small decorations make the device more lively, dynamic and enjoyable :)

I like that there is no animation when screen is deleting. There is animation only when the screen is placed further in the queue. Very intuitive as to whether or not this screen is worth waiting for again. If it left smoothly, it will return later :)

lubeda commented 9 months ago

Hi, i updated my test environment and now, for the first time, I test your PRs before merging. I found a bug. The scroll for the icon_screens works really great, but my id(rgb8x32).icon_clock("emptycal|day#0",1440,10) doesn't work. When the clock is to be displayed I see nothing, only for the last ticks I see how the clock is scrolling down. When there is nothing else in the queue but the icon_clock the icon_clock isn't scrolled and normally displayed

edit: icon_date works fine!

andrewjswan commented 9 months ago

but my id(rgb8x32).icon_clock("emptycal|day#0",1440,10) doesn't work.

Very strange, @chertvl had such a problem yesterday, but it was fixed in the commit. Do you have only one of these screens in your config and that's it? I.e. right at startup one screen and immediately we get this problem?

I need to replicate this problem somehow, and then the cause can be found.

andrewjswan commented 9 months ago

edit: icon_date works fine!

Even stranger, the rendering mechanism for these screens is the same. https://github.com/andrewjswan/EspHoMaTriXv2/blob/2023.9.1-Vertical_scroll_of_screen/components/ehmtxv2/EHMTX_queue.cpp#L584-L730

andrewjswan commented 9 months ago

When the clock is to be displayed I see nothing, only for the last ticks I see how the clock is scrolling down.

This is possible in theory if scroll_reset is less than 8, but by the code it is impossible.

lubeda commented 9 months ago

icon_date and icon_clock don't make the difference, it is the position in the queue. If icon_date or icon_clock is at the first position in the queue, it has the bug. If e.g. icon_screen is in the first position, everything works fine.

lubeda commented 9 months ago

This works:

  on_empty_queue:
    then:
      - homeassistant.event:
          event: esphome.ehmtx_empty_queue
      - lambda: |-
          id(rgb8x32).set_infotext_color(20,20,20,20,20,20,true,1);
          id(rgb8x32).icon_screen("door","Hallo",2,10);
          id(rgb8x32).icon_date("emptycal|day#0",1440,10);      

this not:

  on_empty_queue:
    then:
      - homeassistant.event:
          event: esphome.ehmtx_empty_queue
      - lambda: |-
          id(rgb8x32).set_infotext_color(20,20,20,20,20,20,true,1);
          id(rgb8x32).icon_date("emptycal|day#0",1440,10);
          id(rgb8x32).icon_screen("door","Hallo",2,10);
andrewjswan commented 9 months ago

icon_date and icon_clock don't make the difference, it is the position in the queue. If icon_date or icon_clock is at the first position in the queue, it has the bug. If e.g. icon_screen is in the first position, everything works fine.

Do you have a sample config? So I can replicate it for myself?

andrewjswan commented 9 months ago

this not:

Thanks! I'll check it out while I convert it to a draft...

andrewjswan commented 9 months ago

this not:

Nothing at startup (on_start trigger)? Or is it the same there?

andrewjswan commented 9 months ago

I found ...

andrewjswan commented 9 months ago

@lubeda Can you check?

lubeda commented 9 months ago

The bug is gone 🎉, but the effect doesn't look so good on id(rgb8x32).text_screen("Malle ist nur einmal im Jahr",1440,10); I don't know if it makes sense to fix it

andrewjswan commented 9 months ago

but the effect doesn't look so good on

Do you mean that the icon comes from the top separately, and the long text comes sort of from the top right corner? And then the icon goes down and the text comes in with it? I can probably redo it, but then the effect of vertical scrolling is lost.

PS: Didn't look closely, there's just text coming in from the top right left and then going to the bottom left.

andrewjswan commented 9 months ago

I don't know if it makes sense to fix it

I think not, after all it is vertical scrolling, some will like it, some will not, but everyone can choose for themselves.