Timeout ?
When not using actively the open connexion, the next read/write operation (e.g set_color()) will failed as disconnected, however regularly calling update() will fix the issue.
The Client class may need a kind of keepalive mechanic
Repo with my source code : https://gitea.ar2000.me/AR2000/ed_led_sync
Interesting. This is probably an issue with how the FileSystemEventHandler runtime works. It probably puts the process to sleep until something changes in the file, which apparently closes the socket or something. That's my guess at least. I haven't looked far enough into the docs to know for sure.
If you have something that works, great! I would probably just put the first operation you do after a break in a try block. Something like this will probably work:
def on_modified(self, event):
try:
cli.update()
except OpenRGBDisconnected:
cli.connect()
...
That way you'd just reconnect as needed instead of constantly sending data.
You mentioned that it also happened in the interpreter. Were you using watchdog there as well?
No I'm not. In the interpret I have nothing else loaded. Only the client. But if I forget ot for a while, when comming back to it it crashes (openrgb crashes too)
Interesting. This is probably an issue with how the
FileSystemEventHandlerruntime works. It probably puts the process to sleep until something changes in the file, which apparently closes the socket or something. That's my guess at least. I haven't looked far enough into the docs to know for sure.
Since it happen also in the interpreter it cannot be that