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

number of pages #114

Closed
nagyrobi opened this issue Mar 29, 2021 · 11 comments
Closed

number of pages #114

nagyrobi opened this issue Mar 29, 2021 · 11 comments
Assignees
Labels
done The underlying issue has been fixed
Milestone

Comments

@nagyrobi
Copy link
Collaborator

A quick note: numPages in statusupdate is always 12, while I only defined 5 pages in my .jsonl file.

@nagyrobi nagyrobi added the enhancement New feature or request label Mar 29, 2021
@fvanroie
Copy link
Collaborator

fvanroie commented Mar 29, 2021

yes, esp32 always has 12 pages

@fvanroie fvanroie added documentation Improvements or additions to documentation question Further information is requested and removed enhancement New feature or request labels Mar 29, 2021
@nagyrobi
Copy link
Collaborator Author

nagyrobi commented Mar 29, 2021

I thought numPages would reflect the number of configured pages (aka. pages with at least 1 object on them).
Would be useful to prevent switching to empty pages when keep pressing next.

If numPages busy, could implement another variable for this, in statusupdate.

@fvanroie
Copy link
Collaborator

numPages reflects the maximum number of pages (aka. the maximum number of the last page).

hasp-lvgl has no concept of an empty page. All pages exist at all times and are available to create/delete objects whether you use them or not.

@nagyrobi
Copy link
Collaborator Author

nagyrobi commented Mar 30, 2021

It would be nice to differentiate somehow the pages containing meaningful objects, so that the end-user should not be presented with a page containing irrelevant objects or no objects at all (=empty).

I thought this could be known automatically just by looking at the "page" property of all the objects, and take the highest number from there, which would be helpful on the HA side. That's all.

@fvanroie
Copy link
Collaborator

fvanroie commented Apr 17, 2021

You can now get/set the following attributes on a page object (e.g. p1b0):

  • prev : The number of the destination page when performing a page prev action on this page
  • next : The number of the destination page when performing a page next action on this page
  • back : The number of the destination page when performing a page back action on this page

By default all pages cycle in a round-robbing fashion, but you can change this behaviour by adjusting the prev, next and back target pages:

p1b0.prev=5    // go to page 5 instead of page 12
p5b0.next=1    // start back from page 1

This will cycle through page 1-5 only. back acts like a * level up* action, so you can jump back to the home or menu page where you came from using page back.

@fvanroie fvanroie self-assigned this Apr 17, 2021
@nagyrobi
Copy link
Collaborator Author

How can this be set from jsonl?

@nagyrobi
Copy link
Collaborator Author

@dgomes also CC support has to be added as currently the component calls pages directly by number when next/prev

@dgomes
Copy link
Collaborator

dgomes commented Apr 17, 2021

if the firmware handles this I can remove page control altogether :)

@fvanroie
Copy link
Collaborator

How can this be set from jsonl?

jsonl

{"page":1,"id":0,"next":1,"prev":5,"back":3,"bg_color":"black"}

@fvanroie fvanroie added this to the 0.5.x milestone Apr 18, 2021
@fvanroie
Copy link
Collaborator

This was implemented in 0.5.0

@fvanroie fvanroie added done The underlying issue has been fixed and removed documentation Improvements or additions to documentation question Further information is requested labels Apr 21, 2021
@nagyrobi
Copy link
Collaborator Author

Works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done The underlying issue has been fixed
Projects
None yet
Development

No branches or pull requests

3 participants