Fix WLED & Smoothing (#1567)

* WLED - Fix empty segment element in DB

* WLED - Fix to not overwrite on state when not isStayOnAfterStreaming

* Refactor ProviderRestApi, increase default timeout

* Fix Smoothing - Fix empty updates, consider smoothing configs for effects

* UI - Fix not removed priority

* Add missing header and code updates

* setRedirectPolicy was only introduced in Qt 5.9

* Adalight - Align to HyperSerial v9.0.0

* HyperSerial Hyperion with awa protocol v8.0.0

* Correct line-endings
This commit is contained in:
LordGrey
2023-02-12 21:20:50 +01:00
committed by GitHub
parent a57bcbc2b8
commit bf418686e3
11 changed files with 1594 additions and 203 deletions

View File

@@ -94,7 +94,7 @@ void LedDeviceAdalight::prepareHeader()
break;
case Adalight::AWA:
_bufferLength += 7;
_bufferLength += 8;
[[fallthrough]];
case Adalight::ADA:
[[fallthrough]];
@@ -162,14 +162,20 @@ int LedDeviceAdalight::write(const std::vector<ColorRgb> & ledValues)
{
whiteChannelExtension(writer);
uint16_t fletcher1 = 0, fletcher2 = 0;
uint16_t fletcher1 = 0;
uint16_t fletcher2 = 0;
uint16_t fletcherExt = 0;
uint8_t position = 0;
while (hasher < writer)
{
fletcherExt = (fletcherExt + (*(hasher) ^ (position++))) % 255;
fletcher1 = (fletcher1 + *(hasher++)) % 255;
fletcher2 = (fletcher2 + fletcher1) % 255;
}
*(writer++) = static_cast<uint8_t>(fletcher1);
*(writer++) = static_cast<uint8_t>(fletcher2);
*(writer++) = static_cast<uint8_t>((fletcherExt != 0x41) ? fletcherExt : 0xaa);
}
_bufferLength = writer - _ledBuffer.data();
}