Brightness control fixes (#1)
* refactor light value controls method * fix brightness debug output * partial fixes for brightness control * try to fix white brightness * fix payload debug logging * fix debug output logging * fix light_off message * fix brightness
This commit is contained in:
parent
4417c77875
commit
d20f78ddfe
5 changed files with 106 additions and 57 deletions
|
|
@ -1,3 +1,5 @@
|
|||
#include <vector>
|
||||
#include <cstdio>
|
||||
#include "esphome/core/log.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
|
@ -109,5 +111,16 @@ namespace esphome
|
|||
ctx.f_0x4 = var0;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<char> vector_to_hex_string(std::vector<uint8_t> &data)
|
||||
{
|
||||
std::vector<char> hex_str(data.size() * 2 + 1); // Allocate the vector with the required size
|
||||
for (size_t i = 0; i < data.size(); i++)
|
||||
{
|
||||
sprintf(hex_str.data() + (i * 2), "%02X", data[i]);
|
||||
}
|
||||
hex_str[data.size() * 2] = '\0'; // Ensure null termination
|
||||
return hex_str;
|
||||
}
|
||||
} // namespace fastcon
|
||||
} // namespace esphome
|
||||
Loading…
Add table
Add a link
Reference in a new issue