-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c54a230
commit be2008e
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
class GyverLamp | ||
{ | ||
private: | ||
uint8_t CurrentMode = EFF_LAVALAMP; | ||
|
||
public: | ||
GyverLamp(); | ||
~GyverLamp(); | ||
|
||
void ShowFrame(uint8_t CurrentMode, esphome::Color current_color, light::AddressableLight *p_it); | ||
}; | ||
|
||
GyverLamp::GyverLamp() | ||
{ | ||
} | ||
|
||
GyverLamp::~GyverLamp() | ||
{ | ||
FreeLeds(); | ||
} | ||
|
||
void GyverLamp::ShowFrame(uint8_t CurrentMode, esphome::Color current_color, light::AddressableLight *p_it) | ||
{ | ||
InitLeds(p_it->size()); | ||
|
||
effectsTick(); | ||
|
||
for (int i = 0; i < p_it->size(); i++) | ||
{ | ||
(*p_it)[i] = Color(leds[i].r, leds[i].g, leds[i].b); | ||
} | ||
|
||
#if defined delay | ||
delay(1); | ||
#else | ||
esphome::delay(1); | ||
#endif | ||
} | ||
|
||
class GyverLamp gyver_lamp; |