Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023.9.1: Screen ID, Progress screen, Icon with Text #94

Merged
merged 19 commits into from
Oct 5, 2023
Merged

2023.9.1: Screen ID, Progress screen, Icon with Text #94

merged 19 commits into from
Oct 5, 2023

Conversation

andrewjswan
Copy link

@andrewjswan andrewjswan commented Oct 3, 2023

2023.9.1: Screen ID, Progress screen, Icon with Text

  • Added the ability to specify a screen ID - icon_name|screen_id
  • Added icon and date output screen - icon_date(iconname, lifetime, screen_time, default_font, r, g, b)
  • If pass a screen identifier with the value [day, weekday] like icon_name|day, and a backing icon to icon_clock or icon_date, it will display text.
  • Added a screen with the ability to display a progress bar, progress value (-100..100) - icon_screen_progress(iconname, text, progress, lifetime, screen_time, default_font, r, g, b)

Should solve the issues: #83 #91 #92

* Added the ability to specify a screen ID - icon_name|screen_id
* Added icon and date output screen - icon_date(iconname, lifetime, screen_time, default_font, r, g, b)
* If pass a screen identifier with the value [day, weekday] like icon_name|day, and a backing icon to icon_clock or icon_date, it will display text.
* Added a screen with the ability to display a progress bar, progress value (-1..100) - icon_screen_progress(iconname, text, progress, lifetime, screen_time, default_font, r, g, b)
@andrewjswan
Copy link
Author

The screen ID works fine:

      - service: esphome.esp_pixel_clock_icon_screen
        data:
          icon_name: "weather_{{ states('weather.current_weather') | replace('-','_') }}|weather"
...
      - service: esphome.esp_pixel_clock_icon_screen
        data:
          icon_name: "weather_{{ states('weather.forecast_weather') | replace('-','_') }}|forecast"
...

@andrewjswan
Copy link
Author

andrewjswan commented Oct 4, 2023

Calling icon_clock and icon_date screens with icon|day works fine.

Found bugs:

  • No icon on screen - icon_screen_progress
  • Calling icon_clock and icon_date screens with the icon|weekday parameter leads to a reboot (need to redo the algorithm for getting the current day string).
  • On icon_clock and icon_date screens for some reason a black triangle (2 points in height and width) is displayed on the icon in the lower left corner.

@andrewjswan
Copy link
Author

There is no possibility to test it yet, but in theory the bugs found are fixed.

@lubeda
Copy link
Owner

lubeda commented Oct 4, 2023

what about the docs or a wiki entry for the new features?

@andrewjswan
Copy link
Author

Look like all fixed ...

@andrewjswan
Copy link
Author

andrewjswan commented Oct 4, 2023

what about the docs or a wiki entry for the new features?

If you can tell me which file to make the changes in, I'll do it tomorrow.

PS: I can't promise screenshots

Progress in MODE_ICON_PROGRESS screen:
- 0 .. -100 - from Green to Red
- 0 .. 100 - from Red to Green
- icon|day#mode
- icon|weekday#mode
mode:
- 0 - default - left and right - baseline from font
- 1 - center - baseline from font
- 2 - center - right - baseline from font
- 4 - left and right - baseline 7
- 1 - center - baseline 7
- 2 - center - right - baseline 7
#92 (comment)
@andrewjswan
Copy link
Author

what about the docs or a wiki entry for the new features?

Added to the readme...

Copy link
Author

@andrewjswan andrewjswan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mode:

  • 0 - default - left and right - baseline from font
  • 1 - center - baseline from font
  • 2 - center - right - baseline from font
  • 3 - left and right - baseline 7
  • 4 - center - baseline 7
  • 5 - center - right - baseline 7

@lubeda lubeda changed the base branch from 2023.9.0 to 2023.9.1 October 5, 2023 15:28
@lubeda lubeda merged commit 433cff3 into lubeda:2023.9.1 Oct 5, 2023
3 of 5 checks passed
@lubeda
Copy link
Owner

lubeda commented Oct 5, 2023

Hi @andrewjswan,

it is better to have a PR per new feature! In this PR there are so many new things, its hard to check them. But i will merge this PR to a new branch and test.

@andrewjswan
Copy link
Author

it is better to have a PR per new feature!

I agree, but it happened here that I did all the changes in one go since I didn't have access to a computer and it was already difficult to break it down.

@lubeda
Copy link
Owner

lubeda commented Oct 5, 2023

Things I tested:

  • boot animation 👍especially if you set auto_clear_enabled: false in the display section.
  • icon date 👍
  • screen identifier with the value [day, weekday]: This feature is nice but the implementation is to obscure. there should be a paramter to icon_date/clock with clock/day/weekday. The weekday should be a parameter in the yaml to be more international i can take a look on this at the week end, the fonts are a problem to make this work the fonst hav to be monospaced e.g. 3 pixels an the up/down position is a problem. Perhaps we have to define a default font from trip5 and make only the second font configurable.
  • icon_screen_progress 👍 perhaps the order of the parameters should be icon_screen_progress(iconname, text, lifetime, screen_time, progress, default_font, r, g, b)

I'm still not happy the the screen identifier and the "|" i believe each parameter has to be unambiguously.

To sum it up, you pushed the functionality futher, but we must take care in clean code

@andrewjswan
Copy link
Author

I'm still not happy the the screen identifier and the "|" i believe each parameter has to be unambiguously.

Totally agree. But I was trying to fit the functionality into the current model without expanding it or losing the basic functionality. I think I succeeded.

  • This feature is nice but the implementation is to obscure

It's really bad out there so far, different fonts, different metrics, and you have to fit it all into 8 points. I'm still working on the display.

  • perhaps the order of the parameters should be

You can always change :)

  • boot animation 👍especially if you set auto_clear_enabled: false in the display section.

I'm not quite sure what this is about, I'll have to read up on it.

@andrewjswan
Copy link
Author

To sum it up, you pushed the functionality futher, but we must take care in clean code

Totally support, I tried to implement the concept, but I don't know C++, so I'm not doing as well as I wanted.

@andrewjswan andrewjswan deleted the 2023.9.1 branch October 5, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants