5 zone world Clock Widget #271

Merged
nconner-06 merged 33 commits from dev_worldclock into dev 2025-03-18 22:03:56 +00:00
nconner-06 commented 2025-03-08 21:30:59 +00:00 (Migrated from github.com)

A new widget to show time in 5 different TZ. The name and TZ values are entered on the web interface.

If the zone for a screen is behind the Orb's base zone then there is a red ring, if it is in front then a green ring and no ring if it's in the same TZ.

The time will be one of the following colours:
YELLOW : when it's the weekend for the entered time zone - simple Saturday or Sunday
RED : when out side the working hours for the zone (configurable on the web interface)
WHITE : when in the working hours for the zone

You can switch between 24 and 12 hour - starts in the same setting as the normal clock
The screen also shows if the zone is +/- days from the Orb zone and also the number of hours different.

Note, I needed to make one element of Global Time class visible for this widget - using "getTimeZoneOffset"

Thanks to "DrJay / 3D Emergency Room" for the original base code :-)

A new widget to show time in 5 different TZ. The name and TZ values are entered on the web interface. If the zone for a screen is behind the Orb's base zone then there is a red ring, if it is in front then a green ring and no ring if it's in the same TZ. The time will be one of the following colours: YELLOW : when it's the weekend for the entered time zone - simple Saturday or Sunday RED : when out side the working hours for the zone (configurable on the web interface) WHITE : when in the working hours for the zone You can switch between 24 and 12 hour - starts in the same setting as the normal clock The screen also shows if the zone is +/- days from the Orb zone and also the number of hours different. Note, I needed to make one element of Global Time class visible for this widget - using "getTimeZoneOffset" Thanks to "DrJay / 3D Emergency Room" for the original base code :-)
nconner-06 commented 2025-03-13 14:12:31 +00:00 (Migrated from github.com)

note, that if the PR "Added option for a second API provider for the timeZone information #269" is merged, I'd need to update this PR to align with the change

note, that if the PR "Added option for a second API provider for the timeZone information #269" is merged, I'd need to update this PR to align with the change
brett-dot-tech commented 2025-03-15 01:27:18 +00:00 (Migrated from github.com)

A few small things here:

The business hour checkbox does not seem to be working in removing the rings & colors - I would also suggest having it be white 7 days a week and not yellow on the weekend. (If someone is not tracking business hours it's not something I think they will be worried about, if you're worried about differentiating days of the week we can always add the day of the week [ie. "Wednesday"] to get accommodate this.)

The screens also appear to fully re-draw whenever the time is update, this causes a signifiant "flicker" while they update.
Ideally we just re-draw the time only every minute as the rest of the content is almost always static, and only re-draw things like the coloured rings if that variable changes.

When this is sorted I think we're all set here. I really enjoy this widget and I think we'll have it as one of the defaults, thank you.

A few small things here: The business hour checkbox does not seem to be working in removing the rings & colors - I would also suggest having it be white 7 days a week and not yellow on the weekend. (If someone is not tracking business hours it's not something I think they will be worried about, if you're worried about differentiating days of the week we can always add the day of the week [ie. "Wednesday"] to get accommodate this.) The screens also appear to fully re-draw whenever the time is update, this causes a signifiant "flicker" while they update. Ideally we just re-draw the time only every minute as the rest of the content is almost always static, and only re-draw things like the coloured rings if that variable changes. When this is sorted I think we're all set here. I really enjoy this widget and I think we'll have it as one of the defaults, thank you.
nconner-06 commented 2025-03-16 23:05:23 +00:00 (Migrated from github.com)

Sorry, it looks like my one line correction in widgetSet.cpp for this issue "incorrect time shown on clock when switching widgets #296", has got missed with the new widget.
Let me know if it's an issue and I'll remove it, otherwise the 2 can be merged together

Sorry, it looks like my one line correction in widgetSet.cpp for this issue "incorrect time shown on clock when switching widgets #296", has got missed with the new widget. Let me know if it's an issue and I'll remove it, otherwise the 2 can be merged together
brett-dot-tech commented 2025-03-17 02:50:43 +00:00 (Migrated from github.com)

Heyo @nconner-06 , so I merged your previosu timezone PR and it caused some conflicts. Those will need to be fixed to merge here.

All the other fixes look great however, though for some reasons the time zones do not seems ot be working for me, despite my config showing 5 different time zones, I am just see one across all 5 screens (my config attached). Could this be due to the previous API changes maybe?

Uploading Screenshot 2025-03-16 at 7.50.20 PM.png…

Heyo @nconner-06 , so I merged your previosu timezone PR and it caused some conflicts. Those will need to be fixed to merge here. All the other fixes look great however, though for some reasons the time zones do not seems ot be working for me, despite my config showing 5 different time zones, I am just see one across all 5 screens (my config attached). Could this be due to the previous API changes maybe? ![Uploading Screenshot 2025-03-16 at 7.50.20 PM.png…]()
nconner-06 commented 2025-03-17 07:14:41 +00:00 (Migrated from github.com)

Hi Brett
I think I've resolved the conflicts, just the new matrixWedget, so nothing serious

I can't see your screenshot, what do you get on the screens? and in the serial monitor?

Hi Brett I think I've resolved the conflicts, just the new matrixWedget, so nothing serious I can't see your screenshot, what do you get on the screens? and in the serial monitor?
flattermann commented 2025-03-17 13:42:54 +00:00 (Migrated from github.com)

Please rebase your branch to the latest dev (or merge the latest dev branch into your branch) so that your PR is based on the current code. Thanks.

Please rebase your branch to the latest `dev` (or merge the latest `dev` branch into your branch) so that your PR is based on the current code. Thanks.
nconner-06 commented 2025-03-17 13:50:57 +00:00 (Migrated from github.com)

of course, I'm not an expert with Github, what is the best / easiest way to do this?

of course, I'm not an expert with Github, what is the best / easiest way to do this?
flattermann commented 2025-03-17 13:58:26 +00:00 (Migrated from github.com)

I normally do this on the command line

Switch to dev branch (assuming you have a dev branch that equals upstream dev)

git checkout dev

Pull the newest changes from upstream

git update

Switch to your Branch

git checkout YOURBRANCH

Rebase to dev

git rebase dev

If there are any conflicts, you need to fix them now and then

git rebase --continue

until all conflicts are resolved

in the end, push all your changes to github (rebase needs --force):

git push --force origin

I normally do this on the command line #### Switch to dev branch (assuming you have a dev branch that equals upstream dev) `git checkout dev` #### Pull the newest changes from upstream `git update` #### Switch to your Branch `git checkout YOURBRANCH` #### Rebase to dev `git rebase dev` ##### If there are any conflicts, you need to fix them now and then `git rebase --continue` ##### until all conflicts are resolved #### in the end, push all your changes to github (rebase needs --force): `git push --force origin`
flattermann commented 2025-03-17 16:43:15 +00:00 (Migrated from github.com)

I think you accidently merged upstream/main instead of upstream/dev.

I think you accidently merged `upstream/main` instead of `upstream/dev`.
flattermann commented 2025-03-17 16:51:00 +00:00 (Migrated from github.com)

I have rebased your branch here locally and I can try to push the updates if you want, but I'm not sure if GitHub will let me.

I have rebased your branch here locally and I can try to push the updates if you want, but I'm not sure if GitHub will let me.
nconner-06 commented 2025-03-17 16:53:24 +00:00 (Migrated from github.com)

or I create a new branch based on the current dev and reapply my dev...

or I create a new branch based on the current dev and reapply my dev...
flattermann commented 2025-03-17 16:55:21 +00:00 (Migrated from github.com)

But then you also need to create a new PR and lose the comments here.

Let my try to push my rebasing first. If that does not work, you can always create a new branch/PR.

Ok?

But then you also need to create a new PR and lose the comments here. Let my try to push my rebasing first. If that does not work, you can always create a new branch/PR. Ok?
nconner-06 commented 2025-03-17 16:57:25 +00:00 (Migrated from github.com)

ok, thanks for your help... I have a safe cope of the code on my PC and know which existing programs I needed to change..

I just looked and GlobalTime.cpp doesn't look like the good one

ok, thanks for your help... I have a safe cope of the code on my PC and know which existing programs I needed to change.. I just looked and GlobalTime.cpp doesn't look like the good one
flattermann commented 2025-03-17 17:08:06 +00:00 (Migrated from github.com)

It's as expected: I can't push to your repo unfortunately:

remote: Permission to nconner-06/info-orbs.git denied to flattermann.
fatal: unable to access 'https://github.com/nconner-06/info-orbs/': The requested URL returned error: 403

You could try to fix the branch, because rebasing is often needed when somebody else pushes changes to dev while you are still working on a PR. And sometimes, something goes wrong. :-)

Here's what I did to fix it:

undo last commit ("merge upstream/main")

git reset --hard e87274c3b698ac4e4281693b85bbafb34dfea06d

rebase to current dev

git rebase refs/heads/dev

There were some minor conflicts that I resolved and then used
git rebase --continue

Or create a new branch/PR if you prefer that.

It's as expected: I can't push to your repo unfortunately: ``` remote: Permission to nconner-06/info-orbs.git denied to flattermann. fatal: unable to access 'https://github.com/nconner-06/info-orbs/': The requested URL returned error: 403 ``` You could try to fix the branch, because rebasing is often needed when somebody else pushes changes to `dev` while you are still working on a PR. And sometimes, something goes wrong. :-) Here's what I did to fix it: #### undo last commit ("merge upstream/main") `git reset --hard e87274c3b698ac4e4281693b85bbafb34dfea06d` #### rebase to current dev `git rebase refs/heads/dev` There were some minor conflicts that I resolved and then used `git rebase --continue` Or create a new branch/PR if you prefer that.
nconner-06 commented 2025-03-17 17:32:49 +00:00 (Migrated from github.com)

I tried the command and it didn't work:
C:\Users\HomePC>git reset --hard e87274c3b6
fatal: not a git repository (or any of the parent directories): .git

I tried the command and it didn't work: C:\Users\HomePC>git reset --hard e87274c3b698ac4e4281693b85bbafb34dfea06d fatal: not a git repository (or any of the parent directories): .git
nconner-06 commented 2025-03-17 17:33:34 +00:00 (Migrated from github.com)

Trying with Git desktop, I want to merger upstream/dev into my dev-worldclock, correct?

Trying with Git desktop, I want to merger upstream/dev into my dev-worldclock, correct?
nconner-06 commented 2025-03-17 17:41:24 +00:00 (Migrated from github.com)

like this
image

like this ![image](https://github.com/user-attachments/assets/89dfb715-9ba4-4511-933b-97d12a7e33f8)
flattermann commented 2025-03-17 17:42:36 +00:00 (Migrated from github.com)

You need to be in you local infoorbs directory (therein should be a .git directory) for the git command line to work.

And yes, either rebase dev-worldclock onto upstream/dev (that's what I normally do) or merge upstream/dev into dev-worldclock.

You need to be in you local infoorbs directory (therein should be a .git directory) for the git command line to work. And yes, either rebase `dev-worldclock` onto `upstream/dev` (that's what I normally do) or merge `upstream/dev` into `dev-worldclock`.
nconner-06 commented 2025-03-17 18:17:44 +00:00 (Migrated from github.com)

fingers crossed... I might have managed it..
I think I found the source of the issue.. after creating the branch, I had downloaded it and used that for development, but then also downloaded a version via the Git desktop.... and yes, the 2 copies where not the same :-( I'll have to improve my dev management on my local PC.
Please can you let me know if it looks ok now?
Thanks.

fingers crossed... I might have managed it.. I think I found the source of the issue.. after creating the branch, I had downloaded it and used that for development, but then also downloaded a version via the Git desktop.... and yes, the 2 copies where not the same :-( I'll have to improve my dev management on my local PC. Please can you let me know if it looks ok now? Thanks.
flattermann commented 2025-03-17 18:32:30 +00:00 (Migrated from github.com)

I removed the extra files that sneaked in by merging upstream/main.

Looks good now.

I removed the extra files that sneaked in by merging `upstream/main`. Looks good now.
nconner-06 commented 2025-03-17 18:37:34 +00:00 (Migrated from github.com)

Great, thanks for your support

Great, thanks for your support
Sign in to join this conversation.
No description provided.