Closed andrewjswan closed 7 months ago
Maybe better move this from draw update_screen
https://github.com/lubeda/EspHoMaTriXv2/blob/a18101cdee355cb678632351e4f55f36763e1568/components/ehmtxv2/EHMTX_queue.cpp#L395-L406
To tick
with replace this
https://github.com/lubeda/EspHoMaTriXv2/blob/a18101cdee355cb678632351e4f55f36763e1568/components/ehmtxv2/EHMTX.cpp#L1191-L1195
And maybe change
float red, green, blue;
esphome::hsv_to_rgb(this->config_->hue_, 0.8, 0.8, red, green, blue);
this->config_->rainbow_color = Color(uint8_t(255 * red), uint8_t(255 * green), uint8_t(255 * blue));
To
this->config_->rainbow_color = esphome::light::ESPHSVColor(this->config_->hue_, 255, 240).to_rgb();
In my opinion it looks much better.
Question
I see it changes in two places, in one place every
tick
: https://github.com/lubeda/EspHoMaTriXv2/blob/2024.1.0-prerelease/components/ehmtxv2/EHMTX.cpp#L1121-L1128 and in the second place once everyEHMTXv2_RAINBOW_INTERVALL
period: https://github.com/lubeda/EspHoMaTriXv2/blob/2024.1.0-prerelease/components/ehmtxv2/EHMTX_queue.cpp#L395-L406In my opinion, this is somehow not entirely true, maybe it’s worth somehow bringing this to a unified change method? So that it changes only in one place?
True, I don’t quite understand which option is better to leave, but I mean that it is more logical to move the color change from
update_screen
totick
and change it there as soon as the color change time exceedsEHMTXv2_RAINBOW_INTERVALL
.