Skip to content
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

[automation] Added Actions for Play and Say which sets the volume #1854

Merged
merged 4 commits into from
Dec 1, 2020

Conversation

cweitkamp
Copy link
Contributor

  • Added Actions for Play and Say which sets the volume

Signed-off-by: Christoph Weitkamp [email protected]

@cweitkamp cweitkamp added enhancement An enhancement or new feature of the Core automation labels Nov 28, 2020
@kaikreuzer
Copy link
Member

Hm, I am a bit scared of action proliferation by having dedicated types for every parameter combination.
Can't the volume simply be added as an optional parameter to the existing action types?

@cweitkamp
Copy link
Contributor Author

In general I tend to agree. Do you know if it will be backwards compatible regarding JSONDB / DTOs? I assume yes, because configuration parameters are a list.

@kaikreuzer
Copy link
Member

I'd strongly think so as an optional parameter should not be required and thus it should be fine to not have it in the db for older entries. But it might be safer, if you do a quick test of that assumption.

@cweitkamp
Copy link
Contributor Author

I will do that. If it is working I will change this PR accordingly. And I will submit a minor patch for openhab/openhab-addons#9145 too.

Signed-off-by: Christoph Weitkamp <[email protected]>
@cweitkamp
Copy link
Contributor Author

Works flawlessly. I updated this PR.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

…/org/openhab/core/automation/module/media/internal/MediaActionTypeProvider.java
…/org/openhab/core/automation/module/media/internal/MediaActionTypeProvider.java
@kaikreuzer kaikreuzer merged commit 0e7563c into openhab:master Dec 1, 2020
@kaikreuzer kaikreuzer added this to the 3.0.0.M5 milestone Dec 1, 2020
@cweitkamp cweitkamp deleted the feature-play-say-actions branch December 1, 2020 22:02
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/say-action-in-openhab-3-using-js/110345/3

2 similar comments
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/say-action-in-openhab-3-using-js/110345/3

@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/say-action-in-openhab-3-using-js/110345/3

@frest-de
Copy link

I think the Parameter "volume" is not working as it should. Using it with say and googletts in ECMA rules, the volume gets resetted immediately, before the message has finished.

@cweitkamp
Copy link
Contributor Author

Yes, I agree. It is not working like a user expects. But I am afraid the framework is not able to handle it in a better way. The problem is we are living in an asynchronous world. The VoiceManager stores the current volume, sets the given new, volume, sends the media file or audio stream to be played to the AudioSink and restores the old volume afterwards. Most of the sink implementations send an asynchronous request towards the target device or API and return immediately afterwards. At this time the old volume will already be restored but the actual playback of the media is not finished or even started yet.

https://github.com/openhab/openhab-core/blob/3c301772695b80f5c27a23af987bb2cc440b1387/bundles/org.openhab.core.voice/src/main/java/org/openhab/core/voice/internal/VoiceManagerImpl.java#L229-258

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
…enhab#1854)

* Added Actions for Play and Say which sets the volume

Signed-off-by: Christoph Weitkamp <[email protected]>
GitOrigin-RevId: 0e7563c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants