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

Update __init__.py #8

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions flux_led/__init__.py
Expand Up @@ -613,7 +613,7 @@ def setWarmWhite255(self, level, persist=True):
msg.append(0x00)
msg.append(0x00)
msg.append(int(level))
msg.append(0x0f)
msg.append(0xf0)
msg.append(0x0f)
self.__write(msg)

Expand All @@ -638,7 +638,7 @@ def setRgbw(self, r,g,b,w, persist=True, brightness=None):
msg.append(int(g))
msg.append(int(b))
msg.append(int(w))
msg.append(0x0f)
msg.append(0x00)
msg.append(0x0f)
self.__write(msg)

Expand All @@ -661,7 +661,8 @@ def setRgb(self, r,g,b, persist=True, brightness=None):
msg.append(int(g))
msg.append(int(b))
msg.append(0x00)
msg.append(0xf0)
msg.append(0x00)
msg.append(0x00)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simpat1zq thanks for your contribution. Is there any specific reason to have 3 sequential msg.append(0x00) entries?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep in mind that I'm not really a developer. @Danielhiversen asked me to do a pull request with the changes I had made in my file to get my device working. I don't know why there are 3 0x00's in there, but I actually removed it when I realized I had one too many(while I was submitting the first pull request), and my setup didn't work without. So this is what I have in my environment to get it working. I think that Daniel just wants to take a look at these changes to determine what to do with it.

So long story short, I don't know why it needs 3 of them, but that's the only way it works with my device.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @simpat1zq I'll test the changes on my light bulb once I get at home to see it breaks to me as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchellomello Keep in mind that I'm thinking that this specific code will only work on devices that show up as V1 in the MagicHome App. If you have a different version then you may need to do things differently. Daniel just posted some new stuff in this thread:https://community.home-assistant.io/t/cant-change-led-color-on-magichome-led-controller/5653/29

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchellomello : It seems that different versions of the bulbs requires different bytes to be send.
I do not think we will merge this pr, but I am trying to collect the differences between the bulb versions.
Hopefully we can auto detect which versions are required, otherwise we will need to make it configurable.

See the full discussion here: https://community.home-assistant.io/t/cant-change-led-color-on-magichome-led-controller/5653/28

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Danielhiversen Thanks. yes I got it. sounds good.

msg.append(0x0f)
self.__write(msg)

Expand Down