Read the statement by Michael Teeuw here.
Limit Sonos module to only show a specific speaker
-
@strawberry-3.141 said in Limit Sonos module to only show a specific speaker:
if(item.coordinator.roomName === ‘Kitchen’){
It works! hurrah! Thanks. much appreciated.
not sure how to fork the repository - but I can research this bit.
Thank again.
-
just click on fork in the top right corner of github
-
@strawberry-3.141 Can I clarify then… would config file under the sonos module be:
exclude: ‘Bedroom’,‘Living room’,‘Bathroom’,
-
it will be an array so you need to put square brackets around it
exclude: ['Bedroom', 'Living room', 'Bathroom']
you don’t put a config file in the repository, that’s what the user has to add into his config file in
~/MagicMirror/config/config.js
on it’s own.you would have to add the last line into defaults
Module.register('sonos', { defaults: { showStoppedRoom: true, showAlbumArt: true, showRoomName: true, animationSpeed: 1000, updateInterval: 0.5, // every 0.5 minutes apiBase: 'http://localhost', apiPort: 5005, apiEndpoint: 'zones', exclude: [] },
-
This post is deleted! -
@strawberry-3.141 There might be a reason why this hasnt been done before.
If you exclude all rooms in your house leaving ‘Kitchen’ the only one included in your config file,
If Kitchen plays music, and then Living room is grouped in with Kitchen the code works
the name of the rooms displayed would be Kitchen, Living room (the order of the rooms if the order they were grouped)but if you have living room playing music and then group in kitchen, then the order is different, :
Living room, Kitchenand then the code doesnt work.
Im guesing the code you wrote see’s Living room is excluded and then doesnt show the rest?
-
@dinkybluebug245 you forgot to put the mentioned line in the defaults object, this will cause a problem for those who want all rooms displayed, if you add this line and make a commit your pull request will get updated automatically, and i suggest to put also an information aubout this option into the readme file
Edit to your new post, as i said i have no clue about the sonos system and can’t test it I think you will find a way to get around this issue
-
-
@dinkybluebug245 is this what you mean by nested rooms?
$.each(item.members, function (j, member) { room += member.roomName + ', '; });
-
@strawberry-3.141 Yes I think so.
Excluding all rooms but ‘Kitchen’,
Nested rooms "Living rioom, Kitchen’ - shows nothing
Nested rooms "Kitchen, Living room’ shows info