Skip to content

Commit

Permalink
Add colour to remote schedule config (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewturner authored Feb 3, 2024
1 parent 4ec7b35 commit 1069f9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ bool setSchedule(EvtListener *, EvtContext *, long data)
Serial.print(F("Command: SET SCHEDULE "));
Serial.println(data);
displaySchedule.update(data);
colorSchedule.update(data);
if (showAfterSet)
{
stateMachine.transition(SHOWING);
Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RTC_DS3231 clock;
EvtManager mgr;
Timezone *timezone;
CRGB::HTMLColorCode knownColors[4];
Schedule<byte> colorSchedule(0);
Schedule<byte> colorSchedule(0, 2);
Schedule<Flags> displaySchedule(Flags::NONE, 1);
SoftwareSerial bluetoothSerial(RECEIVE_PIN, TRANSMIT_PIN);
EvtCommandListener commandListener(&bluetoothSerial, 20);
Expand Down
8 changes: 8 additions & 0 deletions test/test_schedule/test_schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ void test_updates_only_specified_second_half(void)
TEST_ASSERT_EQUAL(2, target.valueFor(14, 59));
}

void test_does_not_update_non_matching_identifier(void)
{
bool actual = target.update(914022);

TEST_ASSERT_FALSE(actual);
}

int main(int argc, char **argv)
{
UNITY_BEGIN();
Expand All @@ -103,6 +110,7 @@ int main(int argc, char **argv)
RUN_TEST(test_does_not_update_invalid_quarter_flag);
RUN_TEST(test_updates_only_specified_first_half);
RUN_TEST(test_updates_only_specified_second_half);
RUN_TEST(test_does_not_update_non_matching_identifier);
UNITY_END();

return 0;
Expand Down

0 comments on commit 1069f9c

Please sign in to comment.