Closed fribse closed 2 years ago
That's odd - I'd say the discover function ran twice that time, because it shouldn't have found the same light twice in one discovery... I'll check that out when I get a chance though. If you run this codebase again, does it always detect the same light twice?
I've just gotten my 480RGB, and now that is detected twice. That might be because of 'channel' settings on the light. It was set to channel 5, and then it didn't want to connect. I then changed it to 0, and then it connected. I've now changed it to 1, and it still connects. If I shut down the program, and starts it again it finds the lights, and now only shows 1 of each. I can see that when I turn it off in the windows app, it shows a flashing clock on the back, which (if I recall right) is different from when doing it from the android app
Huh... - interesting - yeah, that's how the iOS app works too, when you just close it, the light stays connected. I think that's because the Neewer app keeps a persistent link to the light, so closing it (not quitting out) is just like minimizing NeewerLite-Python in Windows - it's not on screen, but they're still linked together. If you force quit out of the Neewer app (at least in iOS), then the light's icon starts blinking again as if it's been unlinked in Nl-P. Quitting out of the program (not the app) tries to sever that link before completely closing, that's why it shows the "Successfully unlinked from light..." lines in the console.
I'm curious about the double-detection, because I have my code structured so that shouldn't happen (it looks for the MAC address of any new lights found, and if it finds that it matches an already existing light, it doesn't add a new instance of that light)
...but maybe there's something going on with the channel as you've said, or I may need to structure that section differently. I'll have to look more into this one!
OK, I've reorganized that section of code to look more closely at the MAC address (it was scanning the entire list as a whole before, I limited the comparison to only check one element of that list now) - what I believe has been happening on your end is the light has been disconnecting (possibly due to the Bluetooth dongle's range, but I'm not 100% certain on that), and re-finding itself somehow. I tested the new code by scanning for lights, finding 2 of them, walking away with the lights to another room (until the BT icon started flashing), and then rescanning them again. The program finds the lights again, says "these are already in here", but now I've also added the requirement that if a light is found twice, the link is attempted a 2nd time, as Bleak may have lost connection to the original instance of that light.
I'll have to test it this weekend, btw. the 480RGB works perfectly, so you can add that to the list as well :-D Now I need to get a better ring light, I wonder if they have an app controlled one as well :-D
Ahh can't wait, I don't see any lights twice currently, I guess I'll close it, and if it happens again, I'll reopen it.
Excellent! Sounds like a plan :)
Hey there
I just tested the http daemon, it seems to show the same light twice: If I try to connect to the one that says 'no' it shows: