mopidy-alarmclock icon indicating copy to clipboard operation
mopidy-alarmclock copied to clipboard

Multi-alarm: mopidy_alarmclock.alarm_manager Could not get current playback volume

Open dubaleeiro opened this issue 4 years ago • 3 comments

Dear @rgov,

I am working on further enhancements on your implementation for multiple alarms and came across to the following error which I can't find any solution... I was wondering whether you could spend some time and take a look:

Dec 28 14:12:02 raspberrypi mopidy[5459]: INFO     [Thread-51] mopidy_alarmclock.alarm_manager Triggering alarm 14:12 alarm
Dec 28 14:12:03 raspberrypi mopidy[5459]: ERROR    [Thread-51] mopidy_alarmclock.alarm_manager Could not get current playback volume
Dec 28 14:12:03 raspberrypi mopidy[5459]: Traceback (most recent call last):
Dec 28 14:12:03 raspberrypi mopidy[5459]:   File "/usr/local/lib/python3.7/dist-packages/mopidy_alarmclock/alarm_manager.py", line 222, in adjust_volume
Dec 28 14:12:03 raspberrypi mopidy[5459]:     current_volume = self.core.playback.volume.get()
Dec 28 14:12:03 raspberrypi mopidy[5459]:   File "/usr/local/lib/python3.7/dist-packages/pykka/_proxy.py", line 219, in __getattr__
Dec 28 14:12:03 raspberrypi mopidy[5459]:     raise AttributeError('{} has no attribute {!r}'.format(self, name))
Dec 28 14:12:03 raspberrypi mopidy[5459]: AttributeError: <ActorProxy for Core (urn:uuid:edb24319-67b2-4d61-96d2-1aaed19a2052), attr_path=('playback',)> has no attribute 'volume'
`459]:     current_volume = self.core.playback.volume.get()
Dec 28 14:12:03 raspberrypi mopidy[5459]:   File "/usr/local/lib/python3.7/dist-packages/pykka/_proxy.py", line 219, in __getattr__
Dec 28 14:12:03 raspberrypi mopidy[5459]:     raise AttributeError('{} has no attribute {!r}'.format(self, name))
Dec 28 14:12:03 raspberrypi mopidy[5459]: AttributeError: <ActorProxy for Core (urn:uuid:edb24319-67b2-4d61-96d2-1aaed19a2052), attr_path=('playback',)> has no attribute 'volume'

Thanks a lot !

dubaleeiro avatar Dec 28 '20 13:12 dubaleeiro

Hi @dubaleeiro, unfortunately I have not used this in many years and the cause of the error is not obvious to me.

rgov avatar Dec 28 '20 14:12 rgov

Hi @rgov, thanks anyway for your feedback.

On Mon, Dec 28, 2020 at 3:23 PM Ryan Govostes [email protected] wrote:

Hi @dubaleeiro https://github.com/dubaleeiro, unfortunately I have not used this in many years and the cause of the error is not obvious to me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DavisNT/mopidy-alarmclock/issues/17#issuecomment-751728576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCKL6I56T5SLNRJ3U3OL33SXCIGHANCNFSM4VMARQXQ .

dubaleeiro avatar Dec 28 '20 16:12 dubaleeiro

@dubaleeiro Looks like the error occurs due to differences in APIs of different Mopidy versions (@rgov's PR is for Mopidy version lower than 3; current version of Mopidy is 3.x). Here is the upgrade to Mopidy 3 (and Python 3) that was done in the stable version of Mopidy-AlarmClock (changes in Mopidy APIs used by stable version should be visible there): https://github.com/DavisNT/mopidy-alarmclock/commit/ca7fe9aa3547b32c738d61a4b1e766711507efec

DavisNT avatar Dec 28 '20 22:12 DavisNT