🚨 Updates led service to show isConnected
This commit is contained in:
@@ -200,6 +200,9 @@ void ESP32SvelteKit::startServices() {
|
||||
|
||||
void IRAM_ATTR ESP32SvelteKit::loop() {
|
||||
while (1) {
|
||||
#if FT_ENABLED(FT_WS2812)
|
||||
_ledService.loop();
|
||||
#endif
|
||||
_wifiSettingsService.loop();
|
||||
_apSettingsService.loop();
|
||||
#if FT_ENABLED(FT_ANALYTICS)
|
||||
@@ -207,9 +210,6 @@ void IRAM_ATTR ESP32SvelteKit::loop() {
|
||||
#endif
|
||||
#if FT_ENABLED(FT_BATTERY)
|
||||
_batteryService.loop();
|
||||
#endif
|
||||
#if FT_ENABLED(FT_WS2812)
|
||||
_ledService.loop();
|
||||
#endif
|
||||
_peripherals.loop();
|
||||
delay(20);
|
||||
|
||||
@@ -41,13 +41,17 @@ class LEDService {
|
||||
if (_brightness >= 200) direction = -5;
|
||||
if (_brightness <= 50) direction = 5;
|
||||
_brightness += direction;
|
||||
fillFromPallette(0);
|
||||
if (WiFi.isConnected()) {
|
||||
fillFromPallette(OceanColors_p, 0);
|
||||
} else {
|
||||
fillFromPallette(ForestColors_p, 128);
|
||||
}
|
||||
FastLED.show();
|
||||
});
|
||||
}
|
||||
|
||||
void fillFromPallette(uint8_t colorIndex) {
|
||||
CRGB color = ColorFromPalette(currentPalette, colorIndex, _brightness, currentBlending);
|
||||
void fillFromPallette(CRGBPalette16 colorPalette, uint8_t colorIndex) {
|
||||
CRGB color = ColorFromPalette(colorPalette, colorIndex, _brightness, currentBlending);
|
||||
for (int i = 0; i < WS2812_NUM_LEDS; ++i) {
|
||||
leds[i] = color;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user