mendhak / waveshare-epaper-display

At-a-glance dashboard for Raspberry Pi with a Waveshare ePaper 7.5 Inch HAT. Date/Time, Weather, Alerts, Google/Outlook Calendar
https://code.mendhak.com/raspberrypi-epaper-dashboard/
449 stars 66 forks source link

Allow multiple layouts, allow custom data #37

Closed mendhak closed 2 years ago

mendhak commented 2 years ago

Issue #31
In this PR I am adding the ability to let the user choose from multiple layouts.
I'm also adding the ability to let the user add custom data.

To do this I've first had to extract all the icon files out into its own folder.
This is to simplify the templates and let users rearrange the text, and not have to deal with the numerous icons.
It will also make changing the icons easier, in the future.

Layouts

To choose a layout, add this value to env.sh. Set it to 1, 2, 3, 4 corresponding to the layout.

export SCREEN_LAYOUT=1  

Layout 1 The default, with time, weather on left and calendar on right.
image

Layout 2
More calendar entries, less emphasis on weather and time.
image

Layout 3 Calendar on the left with less emphasis on weather. image

Layout 4
Similar to Layout 3, but hour only (without minutes) due to slower render speed on color epaper screens. image

Adding custom data

I've added the ability to add custom data to the screen. For example this could be API calls, data from Home Assistant, or something external.

Rename screen-custom-get.py.sample to screen-custom-get.py and set the value of custom_value_1 to the value you want to display. Run ./run.sh and it'll appear on screen.

Modify screen-custom.svg and change the x, y, font size values to adjust its appearance and position. You can add more values by adding more SVG elements for custom_value_2 and so on, and set its value in the output_dict in screen-custom.get.py.

jmason commented 2 years ago

fantastic, looks great! 🚀