gickowtf / pixoo-homeassistant

Home Assistant Integration for Divoom Pixoo 64
MIT License
112 stars 12 forks source link

"Duration" from a variable #70

Closed hphd70 closed 2 weeks ago

hphd70 commented 4 months ago

I am struggling around with following issue: I want to define the duration of the pages with a input_number.

I cannot get this work.

duration: "{{ states('input_number.divoom_duration') }}"

With the following code the value of the variable will be displayed:

- type: text
  content: "{{ states('input_number.divoom_duration') }}"
  font: five_pix
  position:
    - 1
    - 1

But as soon I enter the duration part the page will not be displayed

What I am doing wrong?

gickowtf commented 4 months ago

There is currently no template support for duration. The duration only supports integer for seconds.

Mrredstone5230 commented 4 months ago

It would be possible to add it, but it would act a bit strange. All I can think is that it would use the value of the template when the page first gets rendered. If the template changes during the time the page is displayed, it will be ignored.

(Although I do confirm it's not yet implemented in the integration.)

hphd70 commented 4 months ago

I have 4 pages configured to display. My thoughts are that I change the duration value in HA, when the last (4th) page is displayed and the first is the next again, the new value will be taken (for all pages).