MiczFlor / RPi-Jukebox-RFID

A Raspberry Pi jukebox, playing local music, podcasts, web radio and streams triggered by RFID cards, web app or home automation. All plug and play via USB. GPIO scripts available.
http://phoniebox.de
MIT License
1.3k stars 394 forks source link

🐛 | GenericMultiTimerClass broken #2386

Open hoelger opened 2 weeks ago

hoelger commented 2 weeks ago

Version

3.5.3

Branch

future3/main

OS

Ubuntu 22.04

Pi model

Laptop

Hardware

No response

What happened?

1) https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/future3/main/src/jukebox/jukebox/multitimer.py#L249 self._function = self._callee(*self.class_args, iterations=self._iterations, **self.class_kwargs) Instead of modifying the function call, so that later self._function can be called, here the function is already executed. In my case the return value is None, so later the MultiTimer tries to call none, and the program dies.

2) GenericMultiTimerClass tries to pass on the paramter iterations and MultiTimer tries to pass on parameter iteration so this clashes.

Should those two classes be interchangeable or not? I don't get the value of GenericMultiTimerClass because you can build just the same thing by simply using the MultiTimer so my cleanest suggestion is: Delete the GenericMultiTimerClass.

If you want to keep it, here's a fix that worked for me, on first shallow testing: FixGenericMultiTimerClass.patch.txt

Logs

No response

Configuration

No response

More info

No response

hoelger commented 2 weeks ago

Also see typos in the same file: typo.patch.txt

pabera commented 2 weeks ago

Thanks @hoelger .. In which situation did you call this function. I am currently working on a PR to implement the timers. You did not use this branch, correct? #2332

hoelger commented 2 weeks ago

Ah sorry, yes, I did not thoroughly look through other issues nor the state on development. So no, I just used this functionality on top of future3/main.