Closed fribse closed 2 years ago
Thanks for saying so @fribse! βΊοΈ Those are all good suggestions - I did implement a check for connection in the last set of updates, so in the latest versions, if the light disconnects from the Bleak source in any way, the GUI will now show a "NOT LINKED" and "Light disconnected!" error message letting you know that a relink needs to happen. The lights remembering what they were last set to wouldn't be too hard to implement, they'd be stored in the individual light preferences. Retrying the connection would be nice, that would probably need to be sent to a background thread (due to the multiple attempts setup). Presets would be awesome also, I'm working on writing a global preferences system now, that should be in the next update - the actual mechanics are written, but I need to add it to the GUI.
OK, well, I have added this in - or at least partially... at the moment. The GUI is still not set up for making a global preferences file yet, but the logic for the preferences themselves is all programmed now.
To test it:
NeewerLite-Python.prefs
text file in the same directory as NeewerLite-Python, add the line rememberLightOnExit=1
to that file, and save itLoading global preferences from file...
on launchYou asked NeewerLite-Python to save the last used light parameters on exit, so we will do that now..
light_prefs
folder will be created (if there isn't one already), and sidecar files (one for each light) will be createdI'll look at it after work tomorrow, it's 23.30 and I need to be sleeping π
Ha, as someone who's had insomnia literally since I was born... I definitely get that π
I see the 'Loading global preferences from file. Not sure what is happening after that. I now have three lights, and it seems that the last light has problems in connecting (always the last, no matter if I have power to two or three lights).
I now see this error:
[17:25:33] - Attempting to link to light 3 [NEEWER-RGB176] MAC Address: C0:50:A7:8C:95:BA (Attempt 1 of 6)
[17:25:35] - Successfully linked to light 3 [NEEWER-RGB176] MAC Address: C0:50:A7:8C:95:BA
[17:25:38] - Background Thread Running
[17:25:41] - Going into send mode
[17:25:41] - Leaving send mode and going back to background thread
[17:25:42] - Background Thread Running
Exception in thread workerThread:
Traceback (most recent call last):
File "D:\Python\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "D:\Python\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "d:\neewer\NeewerLite-Python.py", line 1242, in workerThread
_loop.run_until_complete(getLightChannelandPower(a))
File "D:\Python\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "d:\neewer\NeewerLite-Python.py", line 1055, in getLightChannelandPower
if powerInfo != "" and powerInfo[3] == 1:
IndexError: bytearray index out of range
In this run, the 'last light' was the RGB176
Hmm... (ha, yes, I'm up now - told you, insomnia π ) - that error looks like it's having an issue with the request from the light to get the power status/channel info from (I'm guessing) the RGB176. Is the 'last light' always that model? And is that the error that gets thrown every time? In that example, it looks like the light links correctly, but has issues getting the power/channel info. Maybe the RGB176 sends that data differently? The "bytearray index out of range" error means that powerInfo (a list with the returned data from the light) can't access the 3rd element of it (as there aren't 3 elements in the data it receives), but it's also not empty ( != "" ) - so there's something there, but not enough information to decipher the returned info from the light...
I just pushed a slight change to that channel/power return logic - now if it doesn't return enough data, it just says that, and then prints out the information the light did send back. There might be something "different" going on with the RGB176... or something else might be going on... π€
Damned @taburineagle , that's really bad, I only sleep badly when work bothers me too much, but thank god I have a sweet wife that takes care of me then β€οΈ I don't see a way to set channel on the RGB176, so I guess there is none. There is only a big dial on the back of it. I haven't looked into the guide yet, so there might be something somewhere. The RGB176 isn't always the last, and sometimes I don't see a problem. I guess I really have to look into that BT debugging again, would be nice if I could get you some data. In this last run, two of the lights didn't show the channel: But they still react as they should, oh and the 'restore settings' works perfectly it seems. After turning off the lights now I got this message again:
[22:43:18] - Background Thread Running
Exception in thread workerThread:
Traceback (most recent call last):
File "D:\Python\lib\threading.py", line 973, in _bootstrap_inner
self.run()
File "D:\Python\lib\threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "d:\neewer\NeewerLite-Python.py", line 1242, in workerThread
_loop.run_until_complete(getLightChannelandPower(a))
File "D:\Python\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "d:\neewer\NeewerLite-Python.py", line 1055, in getLightChannelandPower
if powerInfo != "" and powerInfo[3] == 1:
IndexError: bytearray index out of range
Oh, and the RGB176 goes completely off rather quickly (5-10 mins or so), in contrast to the 660's, they are just running in standby all the time, just fine.
Ahh, that's sweet π It's honestly not that bad - my sleep schedule is kind of all over the place to begin with - I work 3rd shift, and sleep in 2 4-6 hour shifts during the day. It's a bit different, but it lets me have time in the afternoon to get things done, and also gives me more raccoon time - ha, I might as well be a raccoon at this point π€£
Have you tried the latest commit with those 3 lights? That commit's addition should fix that error (it will still throw an error, but won't quit out - and the newest commit should show the data coming from the light when it errors out, and which light actually sends the error which should help diagnose the issue) - that actually makes sense, if you can't change the channel on the RGB176, it wouldn't indicate a channel in the data - so it wouldn't send back enough data to parse that properly (because it doesn't have it). Also... yes! the SL-80 does the same "turning off after 5 minutes" thing! That's why I put that little message when you turn the light off that "A long period of inactivity may require a re-link to the light" - that's also why I was kind of hesitant to include the power off function in the first place when I started the project, because (again, my main reason for writing the program in the first place was - raccoon time) I didn't want the light shutting off randomly where it couldn't be re-triggered on a motion sensor event. Although I also have since noticed that neither the SNL or RGB-660s do that... ha, so it's a mixed bag.
Good to hear that you found a system :-) I've moved the specific rgb176 issues to the thread I made for that light. I think the 'preset' thing is a seperate thing, but it's looking very promising I must say :-) They are VERY cute those raccoon's, I've never seen one, except in captivity, we don't have those in europe :-)
That sounds good with the alternate issue, I'll follow up there as well.
Also, thanks for saying so! Ha, of course last night I ended up sleeping for 10 hours, so it's not every day that's an issue π Yeah, raccoons have fascinated me for a while - it took me 12 years before I was actually able to see them anywhere near me (I live next to a highway, so that's not happening here), and after I found a place where I can see them, it took another 7 years of setting various projects up for them before they actually came up to me, personally but it amazes me when they visit - it's like spending a little bit of time in their world.
Here's a video from the same night as that picture - https://www.youtube.com/watch?v=yWOApd5t1pw
I've heard that an animal similar to raccoons in Europe is the European Badger, those look interesting too, although I'm not sure how widespread they are in Denmark.
OK, I'm closing this one for now as well - I added the "presets" enhancement goal to its own ticket.
Hi @taburineagle Wow, this is really taking off, great work with the release! I was just contemplating that it should remember what the lights was set to on the last run. I also think that it should remember the lights from the last run when we get to it, and just reconnect silently in the background. I know I will probably NEVER use that π as I will set it up via the stream deck button when I get to it, but nevertheless. Some presets would be cool as well, but that is going to be way more complicated, because which lights are they set up for, not all, all, some have been replaced etc.