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

Add volume setting to talk on speaker #2179

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bertrandda
Copy link
Contributor

@bertrandda bertrandda commented Dec 3, 2024

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:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community (french forum/english forum) for testing before merging.
  • If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • Did you add fake requests data for the demo mode (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...)

image

Copy link

relativeci bot commented Dec 3, 2024

#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  Change 2 changes Regression 1 regression
                 Current
#2921
     Baseline
#2919
Regression  Initial JS 5.64MiB(+0.02%) 5.64MiB
No change  Initial CSS 304.89KiB 304.89KiB
Change  Cache Invalidation 54.06% 0%
No change  Chunks 51 51
No change  Assets 173 173
No change  Modules 1511 1511
No change  Duplicate Modules 21 21
No change  Duplicate Code 0.83% 0.83%
No change  Packages 124 124
No change  Duplicate Packages 3 3
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#2921
     Baseline
#2919
Regression  JS 7.43MiB (+0.02%) 7.43MiB
No change  IMG 2.54MiB 2.54MiB
No change  CSS 321.79KiB 321.79KiB
No change  Fonts 93.55KiB 93.55KiB
No change  Other 17.79KiB 17.79KiB
No change  HTML 13.58KiB 13.58KiB

Bundle analysis reportBranch bertrandda:feat/talk-speaker-vol...Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.53%. Comparing base (6a1779d) to head (49d69bc).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...r/services/google-cast/lib/google_cast.setValue.js 90.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for this PR 🙏
It's great!

One design question: could you put the volume bar full width?

392149567-9ba30785-59f5-4f0f-bbb5-9e3bfe83b9f5

}
});
}

Copy link
Contributor

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

Copy link
Contributor Author

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 });
Copy link
Contributor

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 });
Copy link
Contributor

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) => {
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

@bertrandda
Copy link
Contributor Author

One design question: could you put the volume bar full width?
I try but nothing works, 😅.
It seems to be global, brightness has also the issue

image

Do you think it can be fixed in @gladysassistant/theme-optimized

@Pierre-Gilles
Copy link
Contributor

One design question: could you put the volume bar full width?
I try but nothing works, 😅.

Shit! :D

Do you think it can be fixed in @gladysassistant/theme-optimized

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

?

@bertrandda
Copy link
Contributor Author

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

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