rejuvenate/lovelace-horizon-card

Ability to Flip Sunrise and Sunset times for Southern Hemisphere

jcmleng opened this issue · 5 comments

Firstly, many thanks for the card - it is awesome! A request - Is it possible to create a parameter which allows the position of the Sunrise and Sunset times to be flipped?

The southern_flip setting works well and allows the graph to move from sunrise to sunset correctly but this moves left to right, which is west to east in the southern hemisphere.

The perfect end state would be to keep the nothern hemisphere right-to-left graph movement, but allow the change of the Sunset time to be on the left (instead of right) and the Sunrise time to be on the right (instead of the left). This will then show the correct movement of the sun in the southern hemisphere.

Many thanks again!

Hey @jcmleng you slightly lost me in the details there :D but if you are confident this is a reasonable and clean way to improve the component for users on the southern hemisphere, let's add this.
Would you like to work on a PR? Your contribution would be very welcome!

@ThomDietrich , hoping this picture will help. Had to think about it a few times to get it right, I hope:

It is now 2115 in Perth, Western Australia. When I set southern_flip: true, the sun moves correctly from left to right, but the display is confusing as the sun is moving from "sunset" to "sunrise" as it moves left to right.

If southern_flip: true

  • move label "Sunset" and sunset_time to left
  • move label "Sunrise" and sunrise_time to right
  • then same logic as currently for the sun to move right-to-left

image

I would love to work on a PR to help out but unfortunately I do not have any json programming knowledge to be able to meaningfully help. Specifying high-level logic is as best as I can do ... thanks again for ths wonderful card!

Ah, yeah that makes absolute sense. Thanks for the picture and additional explanation.
@avataar @edwardtfn wdyt?

Everyone, this feature request is open for contributions :)

Hi,
Not sure if this is the better solution to the issue;
This is the normal Northern Hemisphere, time moves from Left to right with all the rising and setting sides are matching.
image

However, for the Southern Hemisphere, time is now moving from Right to Left with all the rising and setting sides now mismatching.
image

So is it possible to reverse what is happening with the time scale to also be left to right if it is Southern Hemisphere.

This should be an easier fix.
Thanks.

Hi,
Just another comment, I've just switch to the default, southern_flip: false, even though I
And this now seems to be so much better, all rising and setting details all line up nicely.
It seems to much effort to flip all associated information for southern, just remove this option and you'll get rid of all the issues being raised, simply Left to Right movement.
What I'm not sure is, if all information calculations are based purely on Lat/Long values, if so, then no need for north/south settings.