The set_sound_alarm service is currently broken and calling it with parameters following parameters:
source: wake-up
channel: forest birds
level: 10
raises KeyError: 10. This is caused by pysomneo defining the order of arguments in a different order than async_set_sound_alarm calling it (level and channel are in the opposite order).
This PR fixes the issue by setting async_set_sound_alarm to call self.set_sound_alarm instead of directly calling pysomneo function. set_sound_alarm avoids this issue by using keyworded arguments.
Additionally, the README example for somneo.set_sound_alarm had the wrong parameters so this fixes them too.
Tested on my hass setup and seems to be working fine.
The
set_sound_alarm
service is currently broken and calling it with parameters following parameters:raises
KeyError: 10
. This is caused by pysomneo defining the order of arguments in a different order thanasync_set_sound_alarm
calling it (level and channel are in the opposite order).This PR fixes the issue by setting
async_set_sound_alarm
to callself.set_sound_alarm
instead of directly calling pysomneo function.set_sound_alarm
avoids this issue by using keyworded arguments.Additionally, the README example for
somneo.set_sound_alarm
had the wrong parameters so this fixes them too.Tested on my hass setup and seems to be working fine.