jensrossbach / node-red-contrib-chronos

Time-based Node-RED scheduling, repeating, queueing, routing, filtering and manipulating nodes
https://jensrossbach.github.io/node-red-contrib-chronos
MIT License
28 stars 1 forks source link

Angle of custom sun position with decimal value #107

Closed Bolukan closed 1 year ago

Bolukan commented 1 year ago

The input of the angle of custom sun positions is rounded to a whole degree. For sun angles the decimal is relevant. P.e. sun angles are like sunrise start (-0.833) en and sunrise end (-0.3). I propose decimal values are accepted.

Possible location for the code change is data.angle = angle.spinner("value");, as the spinner supports only whole numbers - which is ok.

jensrossbach commented 1 year ago

It looks like the value is stored in the precision as you enter it and the rounding takes place only when you reopen the UI of the configuration node (whenever the value is passed to the spinner again). However I agree that this is not so nice and should be changed. How many decimal places do you require for the angle?

Bolukan commented 1 year ago

To add common implemented sun positions (amateur, civil, blueHour, goldenHourDawnStart, etc) no decimal is needed. The start of sunrise is defined as -0.833 degree. So 3 decimals should be enough in all situations.

I really like the clean structure to add extra positions centrally available for use in all nodes. My use case is to use a sun position in multiple nodes that is defined centrally.

jensrossbach commented 1 year ago

Issue has been fixed with release 1.18.4.