-
Notifications
You must be signed in to change notification settings - Fork 1
/
status-led.cpp
51 lines (39 loc) · 1.03 KB
/
status-led.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "status-led.h"
void StatusLed::setPins(uint8_t redPin, uint8_t greenPin, uint8_t bluePin) {
_led.setPins(redPin, greenPin, bluePin);
}
void StatusLed::onBootStarted() {
_led.turnOn(LedColor::Blue);
}
void StatusLed::onBootEnded() {
_led.turnOff(LedColor::Blue);
}
void StatusLed::onWebrequestStarted() {
_led.turnOn(LedColor::Green);
}
void StatusLed::onWebrequestEnded() {
_led.turnOff(LedColor::Green);
}
void StatusLed::onMeasurementStarted() {
_led.turnOn(LedColor::Green);
}
void StatusLed::onMeasurementEnded() {
_led.turnOff(LedColor::Green);
}
void StatusLed::onOtaUpdateStarted() {
_led.turnOff(LedColor::White);
_led.turnOn(LedColor::Orange);
}
void StatusLed::onOtaUpdateEnded() {
_led.turnOff(LedColor::Orange);
}
void StatusLed::onOtaUpdateFailed() {
_led.turnOn(LedColor::Red);
}
void StatusLed::onWifiManagerAccessPointModeStarted() {
_led.turnOff(LedColor::White);
_led.turnOn(LedColor::Orange);
}
void StatusLed::onWifiManagerAccessPointModeEnded() {
_led.turnOff(LedColor::Orange);
}