Thought I would open a new issue for this, instead of commenting in the closed PR. Hope that's ok.
Checklist:
[X] I updated to the latest version available
[X] I cleared the cache of my browser
Release with the issue:
v1.5.1 and prior
Last working release (if known):
n/a
Browser and Operating System:
Tried in both Google Chrome and Microsoft Edge - same results for both browsers.
Description of problem:
I updated to v1.5.1 via HACS and restarted, but fix did not work - still no mute and no volume when using a single player. I verified that I removed the test script that I was using (as well as cleared cache), and it's using the /hacsfiles/maxi-media-player/maxi-media-player.js?hacstag=770072954150 resource.
The volume slider will move and stay to where I adjust it to, but a volume_set request is not passed on to the media_player. I have detailed tracing enabled in my SoundTouchPlus media player, and it is not receiving a volume set request. The mute button does not toggle nor receive a mute request either.
Javascript errors shown in the web inspector (if applicable):
n/a
Additional information:
After checking the above, I did some more testing ...
I merged your changes into my main and test branch, and added some console.log() statements to the media-control-service.ts module i nvarious methods. Like so:
I also verified that the .js resource file had your current changes to the createGroupMembers method (compiled to the following):
createGroupMembers(e,t){const A=[];for(const i of st(e))for(const e of t)e.entity_id===i&&A.push(new wt(e,this.config));return null!=A?A:[this]}
It still appears that the player members array is empty when the volumeSet method is called.
I still think you need the if ((updateMembers) && (player.members.length > 0)) { logic in the media-control-service.ts \ volumeSet method - you only want to execute volumeSetGroup if you are updating multiple players AND there is at least 1 member in the group; or change the way you are calling the volumeSet method to use updateMembers = false.
For the calling of volumeSet method, it seems like the updateMembers value will always be true based upon a reference search of the method. In volume.ts, the @property({ type: Boolean }) updateMembers = true; value does not seem to change anywhere, and is always true, which causes the volumeSetGroup to always be executed in volumeSet method.
Here are my changes to media-control-service.ts that fix the issue (includes console.log messages if you want to test):
Thought I would open a new issue for this, instead of commenting in the closed PR. Hope that's ok.
Checklist:
Release with the issue: v1.5.1 and prior
Last working release (if known): n/a
Browser and Operating System: Tried in both Google Chrome and Microsoft Edge - same results for both browsers.
Description of problem: I updated to v1.5.1 via HACS and restarted, but fix did not work - still no mute and no volume when using a single player. I verified that I removed the test script that I was using (as well as cleared cache), and it's using the
/hacsfiles/maxi-media-player/maxi-media-player.js?hacstag=770072954150
resource.The volume slider will move and stay to where I adjust it to, but a
volume_set
request is not passed on to the media_player. I have detailed tracing enabled in my SoundTouchPlus media player, and it is not receiving a volume set request. The mute button does not toggle nor receive a mute request either.Here's the YAML I am using for the player:
Here's a screenshot of what I see:
Javascript errors shown in the web inspector (if applicable): n/a
Additional information:
After checking the above, I did some more testing ... I merged your changes into my main and test branch, and added some
console.log()
statements to themedia-control-service.ts
module i nvarious methods. Like so:Here's what I see in the console log when I execute a mute command:
Here's what I see in the console log when I execute a volume change command (using slider move):
I also verified that the .js resource file had your current changes to the
createGroupMembers
method (compiled to the following):It still appears that the player
members
array is empty when thevolumeSet
method is called.I still think you need the
if ((updateMembers) && (player.members.length > 0)) {
logic in themedia-control-service.ts \ volumeSet
method - you only want to executevolumeSetGroup
if you are updating multiple players AND there is at least 1 member in the group; or change the way you are calling thevolumeSet
method to use updateMembers = false.For the calling of
volumeSet
method, it seems like theupdateMembers
value will always be true based upon a reference search of the method. Involume.ts
, the@property({ type: Boolean }) updateMembers = true;
value does not seem to change anywhere, and is always true, which causes thevolumeSetGroup
to always be executed involumeSet
method.Here are my changes to
media-control-service.ts
that fix the issue (includes console.log messages if you want to test):