5 zone world Clock Widget #271
No reviewers
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs!271
Loading…
Reference in a new issue
No description provided.
Delete branch "dev_worldclock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 :-)
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
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.
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
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?
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?
Please rebase your branch to the latest
dev(or merge the latestdevbranch into your branch) so that your PR is based on the current code. Thanks.of course, I'm not an expert with Github, what is the best / easiest way to do this?
I normally do this on the command line
Switch to dev branch (assuming you have a dev branch that equals upstream dev)
git checkout devPull the newest changes from upstream
git updateSwitch to your Branch
git checkout YOURBRANCHRebase to dev
git rebase devIf there are any conflicts, you need to fix them now and then
git rebase --continueuntil all conflicts are resolved
in the end, push all your changes to github (rebase needs --force):
git push --force originI think you accidently merged
upstream/maininstead ofupstream/dev.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.
or I create a new branch based on the current dev and reapply my dev...
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?
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
It's as expected: I can't push to your repo unfortunately:
You could try to fix the branch, because rebasing is often needed when somebody else pushes changes to
devwhile 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 e87274c3b698ac4e4281693b85bbafb34dfea06drebase to current dev
git rebase refs/heads/devThere were some minor conflicts that I resolved and then used
git rebase --continueOr create a new branch/PR if you prefer that.
I tried the command and it didn't work:
C:\Users\HomePC>git reset --hard
e87274c3b6fatal: not a git repository (or any of the parent directories): .git
Trying with Git desktop, I want to merger upstream/dev into my dev-worldclock, correct?
like this

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-worldclockontoupstream/dev(that's what I normally do) or mergeupstream/devintodev-worldclock.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.
I removed the extra files that sneaked in by merging
upstream/main.Looks good now.
Great, thanks for your support