• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

net-daemon / netdaemon / 23403721360

22 Mar 2026 01:07PM UTC coverage: 83.944% (-0.2%) from 84.108%
23403721360

push

github

web-flow
Add sun events, i.e. scheduler.RunAtSunset() (#1358)

Co-authored-by: Tomas Hellström <tomas.hellstrom@yahoo.se>

900 of 1191 branches covered (75.57%)

Branch coverage included in aggregate %.

18 of 32 new or added lines in 5 files covered. (56.25%)

3408 of 3941 relevant lines covered (86.48%)

1906.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Extensions/NetDaemon.Extensions.Scheduling/SunEvents/SolarCalendar.cs
1
using Innovative.SolarCalculator;
2

3
namespace NetDaemon.Extensions.Scheduler.SunEvents;
4

5
internal class SolarCalendar : ISolarCalendar
6
{
7
    private readonly SolarTimes _cachedCalculator;
8

NEW
9
    public SolarCalendar(Coordinates coordinates)
×
10
    {
NEW
11
        _cachedCalculator = new SolarTimes(DateTime.Now, coordinates.Latitude, coordinates.Longitude);
×
NEW
12
    }
×
13

14
    private SolarTimes SolarCalculator
15
    {
16
        get
17
        {
NEW
18
            _cachedCalculator.ForDate = DateTime.Now;
×
NEW
19
            return _cachedCalculator;
×
20
        }
21
    }
22

NEW
23
    public DateTimeOffset Sunset => SolarCalculator.Sunset;
×
24

NEW
25
    public DateTimeOffset Sunrise => SolarCalculator.Sunrise;
×
26

NEW
27
    public DateTimeOffset Dusk => SolarCalculator.DuskCivil;
×
28

NEW
29
    public DateTimeOffset Dawn => SolarCalculator.DawnCivil;
×
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc