Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When deactivating all modes, only reactivate the "stay on" mode, not all of them. #3

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

flobbe
Copy link
Contributor

@flobbe flobbe commented Nov 29, 2024

8th bit was too much, there are only 7 modes.

Otherwise the bit for the "stay on" mode is ignored when sending and all modes are deactivated. As a result, when receiving in the transformModeFromHex, 0000000 is turned into 1111111, which reactivates all modes. This fix ensures that when all modes are deactivated, only the "stay on" mode is reactivated (as it was probably intended). The check in transformModeFromHex for 0000000 could even be removed, as the device no longer responds with 0.

Tested with a 24m string of lights with 240 LEDs, similar to the one in img2.jpeg
Bluetooth name: LED-4-02-00000000

By the way: thanks for this great Home Assistant integration!

Otherwise the bit for the “stay on” mode is ignored when sending and all modes are deactivated. As a result, when receiving in the `transformModeFromHex`, 0000000 is turned into 1111111, which reactivates all modes.
This fix ensures that when all modes are deactivated, only the “stay on” mode is reactivated (as it was probably intended).
The check in `transformModeFromHex` for 0000000 could even be removed, as the device no longer responds with 0.
@ambiman
Copy link

ambiman commented Dec 7, 2024

👍 . I had the same problem and this fix works great ! Please accept the commit and provide a new version.
And also thanks for this great integration :)

@JurajNyiri JurajNyiri merged commit a89ee32 into JurajNyiri:main Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants