8000 feat(media_player): add default init volume by xaviml · Pull Request #18 · crserran/home-alarm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(media_player): add default init volume #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

xaviml
Copy link
Contributor
@xaviml xaviml commented Jan 19, 2023

This PR adds a new optional attribute for the Media Player alert - default_init_volume.

When the alarm is triggered, Home Alarm collects the current volume level of all media player to then restore initial volume once alarm is stopped (btw, love this feature!). However, some media players do not support volume_level when they are turned off, so the attribute cannot be retrieved and it is marked as None. Then, when it tries to restore it, the code fails since it cannot change volume to None.

This PR adds a default init volume option for such cases. So, if the retrieved volume from the media player is None, then it will be assigned the default_init_volume value. If the media players contain the volume_level before turning on, then, nothing will change for those.

@xaviml xaviml force-pushed the feat/default-init-volumne branch from 60c9f52 to 15c126b Compare January 19, 2023 17:17
@xaviml xaviml force-pushed the feat/default-init-volumne branch from 15c126b to 144c688 Compare January 29, 2023 17:50
@crserran crserran merged commit a0b614c into crserran:dev Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0