Skip to content

Commit 1111383

Browse files
committed
Use sunrise and sunset
1 parent 3885598 commit 1111383

2 files changed

Lines changed: 1 addition & 16 deletions

File tree

‎src/displayapp/DisplayApp.cpp‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -751,25 +751,11 @@ bool DisplayApp::InvokeMotionAutoBright() {
751751
if (!settingsController.GetMotionAutoBrightSetting()) {
752752
return false;
753753
}
754-
if (!DisplayApp::Daytime()) {
754+
if (this->controllers.weatherController->IsNight()) {
755755
return false;
756756
}
757757
if (!motionController.Locomotion()) {
758758
return false;
759759
}
760760
return true;
761761
}
762-
763-
bool DisplayApp::Daytime() {
764-
// TODO - enable these to be the values from Gadgetbridge weather
765-
static constexpr uint8_t hourSunRise = 7;
766-
static constexpr uint8_t minSunRise = 0;
767-
static constexpr uint8_t hourSunSet = 19;
768-
static constexpr uint8_t minSunSet = 0;
769-
uint8_t hour = dateTimeController.Hours();
770-
uint8_t minute = dateTimeController.Minutes();
771-
if ((hour <= hourSunRise && minute <= minSunRise) || (hour >= hourSunSet && minute >= minSunSet)) {
772-
return false;
773-
}
774-
return true;
775-
}

‎src/displayapp/DisplayApp.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ namespace Pinetime {
130130
void LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction);
131131
void PushMessageToSystemTask(Pinetime::System::Messages message);
132132
bool InvokeMotionAutoBright();
133-
bool Daytime();
134133

135134
Apps nextApp = Apps::None;
136135
DisplayApp::FullRefreshDirections nextDirection;

0 commit comments

Comments
 (0)