-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add volume setting to talk on speaker #2179
base: master
Are you sure you want to change the base?
Add volume setting to talk on speaker #2179
Conversation
#2921 Bundle Size — 10.41MiB (+0.01%).49d69bc(current) vs f961aef master#2919(baseline) Warning Bundle contains 3 duplicate packages – View duplicate packages Bundle metrics
|
Current #2921 |
Baseline #2919 |
|
---|---|---|
Initial JS | 5.64MiB (+0.02% ) |
5.64MiB |
Initial CSS | 304.89KiB |
304.89KiB |
Cache Invalidation | 54.06% |
0% |
Chunks | 51 |
51 |
Assets | 173 |
173 |
Modules | 1511 |
1511 |
Duplicate Modules | 21 |
21 |
Duplicate Code | 0.83% |
0.83% |
Packages | 124 |
124 |
Duplicate Packages | 3 |
3 |
Bundle size by type 1 change
1 regression
Current #2921 |
Baseline #2919 |
|
---|---|---|
JS | 7.43MiB (+0.02% ) |
7.43MiB |
IMG | 2.54MiB |
2.54MiB |
CSS | 321.79KiB |
321.79KiB |
Fonts | 93.55KiB |
93.55KiB |
Other | 17.79KiB |
17.79KiB |
HTML | 13.58KiB |
13.58KiB |
Bundle analysis report Branch bertrandda:feat/talk-speaker-vol... Project dashboard
Generated by RelativeCI Documentation Report issue
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2179 +/- ##
==========================================
- Coverage 98.53% 98.53% -0.01%
==========================================
Files 876 876
Lines 14409 14428 +19
==========================================
+ Hits 14198 14216 +18
- Misses 211 212 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not waiting for the callback to finish, are you sure the volume will be changed when client.launch will be started ?
You can use promisify in utils to turn this in a promise for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍 . Volume is set immediatly, when we play audio from url it needs time to load it, so I thought is was not necessary
@@ -188,12 +188,12 @@ describe('SonosHandler.setValue', () => { | |||
read_only: false, | |||
has_feedback: false, | |||
}; | |||
await sonosHandler.setValue(device, deviceFeature, 'http://test.com'); | |||
await sonosHandler.setValue(device, deviceFeature, 'http://test.com', { volume: 30 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a new test to keep the default volume test ?
@@ -85,15 +85,15 @@ describe('AirplayHandler.setValue', () => { | |||
airplayHandler.scanTimeout = 1; | |||
const devices = await airplayHandler.scan(); | |||
const device = devices[0]; | |||
await airplayHandler.setValue(device, device.features[0], 'http://play-url.com'); | |||
await airplayHandler.setValue(device, device.features[0], 'http://play-url.com', { volume: 30 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a new test to keep the default volume test ?
@@ -22,6 +23,16 @@ async function setValue(device, deviceFeature, value) { | |||
client.connect(ipAddress, () => { | |||
logger.debug('Google Cast Connected, launching app ...'); | |||
|
|||
if (options.volume) { | |||
client.setVolume({ level: options.volume / 100 }, (err, newvol) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're changing the volume for the voice, but what if the user was playing music, will it be super loud after?
I'm wondering if we could get the previous volume with player.getStatus
Then rollback the volume after the announce
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try, I'll check documentation. How does it work when audio notification is terminated on google device? It come back automatically to previous app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea to be honest! :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. But I couldn't do it for Airplay, the lib does not have method to get volume, only set.
Shit! :D
Maybe ^^ Can you try modifying the theme in the node_modules, and if it works, submit a PR here : https://github.com/GladysAssistant/theme-optimized/blob/master/dashboard.css ? |
PR created GladysAssistant/theme-optimized#3 |
Pull Request check-list
To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:
npm test
on both front/server)npm run eslint
on both front/server)npm run prettier
on both front/server)npm run compare-translations
on front)front/src/config/demo.js
) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
Description of change
Please provide a description of the change here. It's always best with screenshots, so don't hesitate to add some!
I add volume in Talk on Speaker form
We need the right volume level for each situation (alert, information notification, small/large room...)