Giter Club home page Giter Club logo

Comments (10)

Mynasru avatar Mynasru commented on September 28, 2024 1

Isn't i updated every time the display updates (update_interval)?

from esphome-docs.

rradar avatar rradar commented on September 28, 2024

Little off topic: the original homie sketch by @mhaack has 4 pages (Temperature, Humidity, etc.) witha very nice layout and a very nice sliding animation/effect while changing the single pages.

Looks a little bit like this and is probably based on homie-display (https://github.com/luebbe/homie-display) from @luebbe

image
image

Something like this (more than one page and animations) is not yet possible with esphomeyaml - right ❓ 😁

from esphome-docs.

OttoWinter avatar OttoWinter commented on September 28, 2024

Awesome setup! Thanks for sharing!

By cookbook entry I meant creating an entry here: https://esphomelib.com/esphomeyaml/index.html#cookbook πŸ˜…

I will try to convert this guide to the docs format soon, so that other users can profit from this :)

@rradar As for the last post: Yes, more than one page is possible:

display:
- platform: some_platform
  lambda: |-
    static int i = 1;
    if (i == 1) {
      // draw first page
      i = 1;
    } else if (i == 2) {
      // draw second page
      i = 3;
    } else if (i == 3) {
      // draw last page
      i = 1;
    }

but animations: no, at least not easily. As you have direct access to the display (you can draw each pixel individually) it is of course technically possible, although it would not be fun to implement.

Animations would need a major rethink of the display engine. This "draw the entire display from scratch every time" approach is great for quick development, but makes animations difficult. Animations would require a framework where you first add a bunch of widgets at setup time and modify them each frame.

from esphome-docs.

rradar avatar rradar commented on September 28, 2024

@OttoWinter I'm trying right now to show more than one page (my idea was to switch the pages after n seconds). I'm not sure how to implement this. With your sketch just page one get's shown. What would be the trigger to change the page here?

Herzliches DankeschΓΆn!

from esphome-docs.

rradar avatar rradar commented on September 28, 2024

Sorry again for asking but how are the pages triggered with this sketch?

display:
- platform: some_platform
  lambda: |-
    static int i = 1;
    if (i == 1) {
      // draw first page
      i = 1;
    } else if (i == 2) {
      // draw second page
      i = 3;
    } else if (i == 3) {
      // draw last page
      i = 1;
    }

It always stays on page 1 for me? πŸ˜•

from esphome-docs.

flozsc avatar flozsc commented on September 28, 2024

It always stays on page 1 for me? πŸ˜•

I think you'll need to set i to 2 after drawing the first page - probably a typo.

display:
- platform: some_platform
  lambda: |-
    static int i = 1;
    if (i == 1) {
      // draw first page
      i = 2;                     // <-- *here*
    } else if (i == 2) {
      // draw second page
      i = 3;
    } else if (i == 3) {
      // draw last page
      i = 1;
    }

from esphome-docs.

mihalski avatar mihalski commented on September 28, 2024

Couldn't the i be the the output from another sensor/input? some sort of toggle.. or timer?

from esphome-docs.

rradar avatar rradar commented on September 28, 2024

@mihalski
I thought a timer (for example 15 seconds) would be sufficient for the first working sketch. Any ideas how to implement this?

from esphome-docs.

minsuke avatar minsuke commented on September 28, 2024

hello

can I make a image change process, conditional weather condition. ?

ex) if 1 then cloudy image, if 2 then sunny image.

I don't know how to make it.

from esphome-docs.

OttoWinter avatar OttoWinter commented on September 28, 2024

@minsuke You'd need to use some C++ if conditions to do that (I think some of the cookbooks on https://esphome.io may have some examples for that).

Anyway, I'm closing this issue because the cookbook is now on esphome.io - not in the GitHub issue section.

from esphome-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.