Skip to content

Add 12h/24h time format in device configuration option (which is used in weather plugin)#148

Merged
fatihak merged 11 commits into
fatihak:mainfrom
JeremyCottontail:feature/weather-plugin-12h-24h-time-format
Jun 4, 2025
Merged

Add 12h/24h time format in device configuration option (which is used in weather plugin)#148
fatihak merged 11 commits into
fatihak:mainfrom
JeremyCottontail:feature/weather-plugin-12h-24h-time-format

Conversation

@JeremyCottontail
Copy link
Copy Markdown
Contributor

Adds a new configuration option to allow users to choose between 12-hour and 24-hour time formats for displaying times throughout the weather plugin.

Changes

  • Added time format selection dropdown to settings UI (12h/24h)
  • Updated sunrise/sunset times to respect selected format
  • Updated hourly forecast times to use selected format
  • Updated last refresh timestamp to use selected format
  • Added helper method format_time() for consistent time formatting
  • Set 12h format as default for backward compatibility

Screenshots

settings
current_image

@fatihak
Copy link
Copy Markdown
Owner

fatihak commented Jun 3, 2025

Thanks for the PR! Can the setting be moved to the device settings page since we already have the timezone selection there, and so this can be used across plugins?

@JeremyCottontail JeremyCottontail changed the title Weather Plugin: Add 12h/24h time format configuration option Add 12h/24h time format in device configuration option (which is used in weather plugin) Jun 4, 2025
@JeremyCottontail
Copy link
Copy Markdown
Contributor Author

@fatihak I implemented the changes. I moved the setting into the device settings page, removed it from the weather plugin settings page and refactored the rest.

Just as a note. I didn't touch the other plugins.

Screenshot 2025-06-04 094447

@fatihak
Copy link
Copy Markdown
Owner

fatihak commented Jun 4, 2025

That's fine, I believe the only other plugin that displays time is the clock plugin which can be updated later. Looks good, merged

@fatihak fatihak merged commit f8fa700 into fatihak:main Jun 4, 2025
acscpt added a commit to acscpt/InkyPi-WS that referenced this pull request Jun 4, 2025
* Make plugins more plug-in (fatihak#101)

* Make plugins more plug-in

Removes the need for a central plugins.json
Each plugin has a `plugin-info.json` which will be loaded on startup

* Sort by plugin folder name

* Add option to change the colors for clock faces (fatihak#81)

* Clock color option fix

* feat: Add option to invert images (fatihak#118)

* Add moonphase to weather plugin (fatihak#99)

* Add moonphase to weather plugin

Option to show moonphase in forecast, added to plugin settings, display icon and percentage of moon

* Fix moon phase

I was not using correctly the API, because 0.5 corresponds to full moon and 0 and 1 equals new moon. Also now percentage show the true illumination percent which needs to be calculated

* Fix Moon icons names

* Fix bug

Was not asking for the correct variable name

* Handle missing sunrise & sunset from OWM, fix weathe line max value, catch exceptions

* Fix weather graph not reaching max values

* Update flask, pytz versions

* fix ai_text setting validation (fatihak#129)

* Image Color settings, ability to shutdown/reboot from UI (fatihak#132)

* Add image settings, shutdown & reboot buttons

* Fix reboot/shutdown buttons, prepopulating image settings

* Fix error when image_settings doesnt exist

* Remove setting saturation in set_image

* NASA Astronomy Picture of the Day plugin (fatihak#131)

* weather: add option for last refresh time (fatihak#127)

Co-authored-by: Fatih Ak <39274028+fatihak@users.noreply.github.com>

* Update playlist.py to use TimeDelta (fatihak#141)

Replaced "day=now.day - 1" logic with Python 3 native date handling (timedelta) to avoid the '0' day issue on the first of every month.

* Added additional reference to 3D printable frame on makerworld for the newer Inky Impression 7.3" (2025 Edition). (fatihak#147)

* Weather: add a margin setting for each side (fatihak#146)

* Fix margins not populating in playlists

* Load image from URL as Plugin (fatihak#100)

* Updated warning on Image URL plugin

* Add 12h/24h time format in device configuration option (which is used in weather plugin) (fatihak#148)

* Add possibility to select time format in settings (default: 12h)

* Implementation of rendering 12h or 24h time format (default: 12h)

* pass "settings" variable to parse_weather_data() method

* implement 12h/24h time format for sunrise and sunset

* Add time format configuration in device settings

* remove time format configuration from weather plugin settings

* get time format configuration from device settings instead weather plugin settings

* Add time format handling to settings backend

* fix validation of time format

* fix issue for getting time format from device settings instead of plugin settings

---------

Co-authored-by: doofmars <git@preuss.in>
Co-authored-by: Eliz <el@users.noreply.github.com>
Co-authored-by: Fatih Ak <fatihak@berkeley.edu>
Co-authored-by: Catto <71943884+CattoSalad@users.noreply.github.com>
Co-authored-by: Jose Miguel Concha <35230589+Ch3my@users.noreply.github.com>
Co-authored-by: dfritsch86 <daniel.fritsch.86@gmail.com>
Co-authored-by: Fatih Ak <39274028+fatihak@users.noreply.github.com>
Co-authored-by: Vincent Manzoni <42293988+Manzovince@users.noreply.github.com>
Co-authored-by: Andy Cook <cookandy@users.noreply.github.com>
Co-authored-by: phattmatt <matt.seddon@gmail.com>
Co-authored-by: Jeremy Haas <40786381+JeremyCottontail@users.noreply.github.com>
Co-authored-by: Reid Kornman <76536916+Reid-Kornman@users.noreply.github.com>
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