gickowtf / pixoo-homeassistant

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

[Feature] Added a rectangle component #50

Closed Mrredstone5230 closed 5 months ago

Mrredstone5230 commented 5 months ago

Added a rectangle component. Accepts position, size, but also optionally color, and filled tags. (If filled set to true, the rectangle will be filled (default). If not, only the border of the rectangle will be drawn.)

(All fields can accept templates)

Example usage:

page_type: components
components:
  - type: rectangle
    position:
      - 4
      - "{{ states('input_number.kml') }}"
    size:
      - "{{ states('input_number.kml') }}"
      - 6
    color: yellow
    filled: "{{ states('input_number.kml')|int >= 5 }}"
gickowtf commented 5 months ago

Hey that's funny I really wanted to add something again and had already thought about the rectangle last night ... You were faster 👍 I'll merge your two PR tonight

gickowtf commented 5 months ago

Added a rectangle component. Accepts position, size, but also optionally color, and filled tags. (If filled set to true, the rectangle will be filled (default). If not, only the border of the rectangle will be drawn.)

(All fields can accept templates)

Example usage:

page_type: components
components:
  - type: rectangle
    position:
      - 4
      - "{{ states('input_number.kml') }}"
    size:
      - "{{ states('input_number.kml') }}"
      - 6
    color: yellow
    filled: "{{ states('input_number.kml')|int >= 5 }}"

last time I answered in the wrong PR... I've fixed it now, I just thought that because templates are used in your example here that it would also work ... I think that was probably a mistake in my mind.

Mrredstone5230 commented 5 months ago

Added a rectangle component. Accepts position, size, but also optionally color, and filled tags. (If filled set to true, the rectangle will be filled (default). If not, only the border of the rectangle will be drawn.)

(All fields can accept templates)

Example usage:


page_type: components

components:

  - type: rectangle

    position:

      - 4

      - "{{ states('input_number.kml') }}"

    size:

      - "{{ states('input_number.kml') }}"

      - 6

    color: yellow

    filled: "{{ states('input_number.kml')|int >= 5 }}"

last time I answered in the wrong PR... I've fixed it now, I just thought that because templates are used in your example here that it would also work ... I think that was probably a mistake in my mind.

Templates didn't work before your fix?? I thought they did..

Mrredstone5230 commented 5 months ago

Ohh I see what could have happened. I think the first element of the lists didn't have the variables working, but the second did. Sorry about this...

gickowtf commented 5 months ago

Unfortunately not. But everything is fine now. I only noticed it when I rewrote the progressbar as a component for a readme.

https://github.com/gickowtf/pixoo-homeassistant/blob/main/READMES/progressbar.md