Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 0 additions & 261 deletions src/SunRiSet.cpp

This file was deleted.

86 changes: 0 additions & 86 deletions src/SunRiSet.h

This file was deleted.

10 changes: 5 additions & 5 deletions src/Timer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "Timer.h"
#include "SunRiSet.h"
#include "OpenKNX/Sun/SunRiseAndSet.h"
#include "Arduino.h"
#include <ctime>

Expand Down Expand Up @@ -131,14 +131,14 @@ bool Timer::loop()
return lMinuteChanged;
}

// TODO: Check Migration to Common Time / SunCalculation
// TODO: Fully migrate to Common Time / SunCalculation, but keep in mind we "time travel" in LOG for restore
void Timer::convertToLocalTime(double iTime, sTime *eTime)
{
OpenKNX::TimeOnly localTime = OpenKNX::DateTime(
getYear(),
getMonth(),
getDay(),
(int)floor(iTime),
(int)floor(iTime), // Important: New Constructor with `int` in Param Signature required!
(int)(60 * (iTime - floor(iTime))),
0,
OpenKNX::DateTimeTypeUTC
Expand All @@ -152,7 +152,7 @@ void Timer::calculateSunriseSunset()
{
double rise, set;
// sunrise/sunset calculation
SunRiSet::sunRiseSet(getYear(), getMonth(), getDay(),
OpenKNX::Sun::SunRiseAndSet::sunRiseSet(getYear(), getMonth(), getDay(),
mLongitude, mLatitude, -35.0 / 60.0, 1, &rise, &set);
convertToLocalTime(rise, &mSunrise);
convertToLocalTime(set, &mSunset);
Expand Down Expand Up @@ -211,7 +211,7 @@ void Timer::getSunDegree(uint8_t iSunInfo, double iDegree, sTime *eSun)
{
double rise, set;
// sunrise/sunset calculation
SunRiSet::sunRiseSet(getYear(), getMonth(), getDay(),
OpenKNX::Sun::SunRiseAndSet::sunRiseSet(getYear(), getMonth(), getDay(),
mLongitude, mLatitude, iDegree, 0, &rise, &set);
if (iSunInfo == SUN_SUNRISE)
convertToLocalTime(rise, eSun);
Expand Down
Loading