Dev weather - linked to issue #287 / #298 / #288 plus additional feed #289

Open
nconner-06 wants to merge 12 commits from nconner-06/dev_weather into dev
nconner-06 commented 2025-03-15 11:10:43 +00:00 (Migrated from github.com)

Move the variables for LAT and LOG to float for OpenWeathermap to floats

Move the variables for LAT and LOG to float for OpenWeathermap to floats
flattermann (Migrated from github.com) reviewed 2025-03-15 11:10:43 +00:00
nconner-06 commented 2025-03-16 22:54:19 +00:00 (Migrated from github.com)

This PR handles the following issues:

  • Modify WeatherWidget to use float rather than string for the LAT/Long values #287
  • Use a single config for weather feed #288
  • use Lat/Long for Visual Crossing weather #298

And includes a new feed from Pirate Weather

This PR handles the following issues: - Modify WeatherWidget to use float rather than string for the LAT/Long values #287 - Use a single config for weather feed #288 - use Lat/Long for Visual Crossing weather #298 - And includes a new feed from Pirate Weather
flattermann (Migrated from github.com) requested changes 2025-03-17 12:03:25 +00:00
flattermann (Migrated from github.com) left a comment

I would also comment out the WEATHER_* #defines in config.h.template so that the user can enable what he needs.

And move the default values to config.system.h (if #ifndef) because we might otherwise get compilation errors.

I would also comment out the `WEATHER_*` #defines in config.h.template so that the user can enable what he needs. And move the default values to `config.system.h` (if #ifndef) because we might otherwise get compilation errors.
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
flattermann (Migrated from github.com) commented 2025-03-17 11:42:58 +00:00

The enum should not be defined in config.h.template.

Maybe move it to WeatherWidget.h?

The enum should not be defined in `config.h.template`. Maybe move it to `WeatherWidget.h`?
flattermann (Migrated from github.com) commented 2025-03-17 11:44:25 +00:00

The API URLs should be moved to config.system.h (with ifndef), because a user shouldn't need to override these.

The API URLs should be moved to config.system.h (with ifndef), because a user shouldn't need to override these.
flattermann (Migrated from github.com) commented 2025-03-17 11:45:36 +00:00

The visual crossing API key can also be moved to config.system.h (with ifndef, so that it could be overriden here)

The visual crossing API key can also be moved to `config.system.h` (with ifndef, so that it could be overriden here)
flattermann (Migrated from github.com) commented 2025-03-17 11:47:41 +00:00

The three other WEATHER_VISUALCROSSUNG_* defs should have a default in config.system.h (because we want to be able to build without config.h

The three other `WEATHER_VISUALCROSSUNG_*` defs should have a default in `config.system.h` (because we want to be able to build without `config.h`
@ -42,4 +40,4 @@
#define WEATHER_SCREEN_MODE Dark // Can be either Light or Dark
#define WEATHER_UNITS_METRIC // Comment this line out (or delete it) if you want imperial units for the weather
#define HIGH_LOW_INTERVAL 0 // Switch between Highs and Lows on 3 day forecast in X seconds - set to 0 to disable
flattermann (Migrated from github.com) commented 2025-03-17 11:54:42 +00:00

WEATHER_FEED needs a default in config.system.h (for config.h less builds)

WEATHER_FEED needs a default in `config.system.h` (for `config.h` less builds)
flattermann (Migrated from github.com) commented 2025-03-17 11:57:32 +00:00

I'm not 100% sure, but I think a switch might cause some problems here, because it might compile/link the unnecessary feeds as well? Needs testing.

We could switch to #if WEATHER_FEED == VISUALCROSSING if necessary (but we need to #define VISUALCROSSING 0 because enum items can't be used by the preprocessor)

I'm not 100% sure, but I think a `switch` might cause some problems here, because it might compile/link the unnecessary feeds as well? Needs testing. We could switch to `#if WEATHER_FEED == VISUALCROSSING` if necessary (but we need to `#define VISUALCROSSING 0` because enum items can't be used by the preprocessor)
nconner-06 (Migrated from github.com) reviewed 2025-03-17 12:22:14 +00:00
nconner-06 (Migrated from github.com) commented 2025-03-17 12:22:14 +00:00

Thanks for your feedback, I'll look at your comments.

Did you look at the weather feed .h file, each has a #ifndef section to define the variables, thus I don't know if we need it in config.system.h as well

Thanks for your feedback, I'll look at your comments. Did you look at the weather feed .h file, each has a #ifndef section to define the variables, thus I don't know if we need it in config.system.h as well
nconner-06 (Migrated from github.com) reviewed 2025-03-17 12:27:06 +00:00
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
nconner-06 (Migrated from github.com) commented 2025-03-17 12:27:06 +00:00

the API key for VisualCrossing should be user editable - people can get their own keys (if they want) - like for the other feeds. It's just we provide a key to get them started..

the API key for VisualCrossing should be user editable - people can get their own keys (if they want) - like for the other feeds. It's just we provide a key to get them started..
nconner-06 (Migrated from github.com) reviewed 2025-03-17 12:49:10 +00:00
nconner-06 (Migrated from github.com) commented 2025-03-17 12:49:10 +00:00

As the header files for all the feeds are included in WeatherWidget.cpp, it looks like all the feeds get compiled and linked - even if I change to a "#if" condition...
image

As the header files for all the feeds are included in WeatherWidget.cpp, it looks like all the feeds get compiled and linked - even if I change to a "#if" condition... ![image](https://github.com/user-attachments/assets/e536238c-a014-4fb4-933a-292c48ed7e82)
flattermann (Migrated from github.com) reviewed 2025-03-17 13:05:58 +00:00
flattermann (Migrated from github.com) commented 2025-03-17 13:05:57 +00:00

Right. If the defaults are already set in the individual feed .h, we don't need them in config.system.h.

Maybe include the feeds conditionally as well?

Right. If the defaults are already set in the individual feed .h, we don't need them in config.system.h. Maybe include the feeds conditionally as well?
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:01:14 +00:00
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
nconner-06 (Migrated from github.com) commented 2025-03-18 21:01:14 +00:00

moved to WeatherWideget.h

moved to WeatherWideget.h
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:01:39 +00:00
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
nconner-06 (Migrated from github.com) commented 2025-03-18 21:01:39 +00:00

all URLs moved to their respective feed.h files

all URLs moved to their respective feed.h files
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:03:37 +00:00
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
nconner-06 (Migrated from github.com) commented 2025-03-18 21:03:36 +00:00

VisualCrossing API key left in config.h.template because users can have their own, but the default (provided) key is in the visualcrossing feed with an #ifndef condition

VisualCrossing API key left in config.h.template because users can have their own, but the default (provided) key is in the visualcrossing feed with an #ifndef condition
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:05:30 +00:00
@ -35,22 +35,30 @@
#define DEFAULT_CLOCK ClockType::NORMAL // Set the default clock face: ClockType::NORMAL, ClockType::NIXIE or ClockType::CUSTOM0..9
nconner-06 (Migrated from github.com) commented 2025-03-18 21:05:29 +00:00

all defaults are in their respective feed.h file, all customizable variables are in the config.h.template.
for me, config.systel.h should be for non-widget variables

all defaults are in their respective feed.h file, all customizable variables are in the config.h.template. for me, config.systel.h should be for non-widget variables
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:06:34 +00:00
@ -42,4 +40,4 @@
#define WEATHER_SCREEN_MODE Dark // Can be either Light or Dark
#define WEATHER_UNITS_METRIC // Comment this line out (or delete it) if you want imperial units for the weather
#define HIGH_LOW_INTERVAL 0 // Switch between Highs and Lows on 3 day forecast in X seconds - set to 0 to disable
nconner-06 (Migrated from github.com) commented 2025-03-18 21:06:34 +00:00

default is set in WeatherWidget.h, just below the enum which defines the available values

default is set in WeatherWidget.h, just below the enum which defines the available values
nconner-06 (Migrated from github.com) reviewed 2025-03-18 21:07:59 +00:00
nconner-06 (Migrated from github.com) commented 2025-03-18 21:07:59 +00:00

I tested both way - switch and ifdef (including ifdef on the fee.h files) and it appears that all feeds are included in the compile / ink.. not sure if I was doing any incorrect, if you know a way, then I'm open to suggestions.

I tested both way - switch and ifdef (including ifdef on the fee.h files) and it appears that all feeds are included in the compile / ink.. not sure if I was doing any incorrect, if you know a way, then I'm open to suggestions.
This pull request has changes conflicting with the target branch.
  • firmware/config/config.h.template
  • firmware/config/config.system.h
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin nconner-06/dev_weather:nconner-06/dev_weather
git switch nconner-06/dev_weather

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch dev
git merge --no-ff nconner-06/dev_weather
git switch nconner-06/dev_weather
git rebase dev
git switch dev
git merge --ff-only nconner-06/dev_weather
git switch nconner-06/dev_weather
git rebase dev
git switch dev
git merge --no-ff nconner-06/dev_weather
git switch dev
git merge --squash nconner-06/dev_weather
git switch dev
git merge --ff-only nconner-06/dev_weather
git switch dev
git merge nconner-06/dev_weather
git push origin dev
Sign in to join this conversation.
No description provided.