Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 16

Hybrid View

  1. #1
    Senior Member
    Join Date
    Aug 2012
    Posts
    164

    SqueezeJS.Controller.playerRequest([JSON formatted CLI request])

    How do I set the squeezebox volume through the SqueezeJS framework and JSON format CLI request?


    Is there away to get a complete list of all the properties and objects they are associated to?

    I am trying via IFTTT JSON webhook:

    { "entity_id": "media_player.playername", "command": "volume", "parameters": "0"}

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,530

    SqueezeJS.Controller.playerRequest([JSON formattedCLI request])

    > How do I set the squeezebox volume through the SqueezeJS framework and
    > JSON format CLI request?


    Relative change (-1):
    SqueezeJS.Controller.setVolume(1, '-')

    Absolute:
    SqueezeJS.Controller.setVolume(50)

    > Is there away to get a complete list of all the properties and objects
    > they are associated to?


    What Objects? Properties of what?

    --

    Michael

  3. #3
    Senior Member
    Join Date
    Aug 2012
    Posts
    164
    Thanks as in, is there a list or documentation where I can see for example:

    Controller . SetVolume

    ^ ^
    "Object" "Property"


    And a list of all objects and properties available. Apologies if these are 'termed' differently.
    Quote Originally Posted by mherger View Post
    > How do I set the squeezebox volume through the SqueezeJS framework and
    > JSON format CLI request?


    Relative change (-1):
    SqueezeJS.Controller.setVolume(1, '-')

    Absolute:
    SqueezeJS.Controller.setVolume(50)

    > Is there away to get a complete list of all the properties and objects
    > they are associated to?


    What Objects? Properties of what?

    --

    Michael

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,530

    SqueezeJS.Controller.playerRequest([JSON formattedCLI request])

    > Thanks as in, is there a list or documentation where I can see for
    > example:
    >
    > Controller . SetVolume
    > ^ ^
    > "Object" "Property"


    No, there's not a complete list. Some basics are covered in
    http://wiki.slimdevices.com/index.php/SqueezeJS.

    Other than that, there's the source :-). Base.js has the controller methods:

    https://github.com/Logitech/slimserv...S/Base.js#L248

    --

    Michael

  5. #5
    Senior Member Apesbrain's Avatar
    Join Date
    Jun 2005
    Location
    East Coast, USA
    Posts
    1,675
    I have incorporated a script into a custom "Now Playing" screen which allows control of some Squeezebox functions via keyboard:
    Code:
    <!-- Binding arrow keys to functions: https://craig.is/killing/mice -->
    <script type="text/javascript" src="/html/ext/mousetrap.js"></script>
    <script type="text/javascript">
    	Mousetrap.bind ('up', function() {SqueezeJS.Controller.setVolume(1, '+')});
    	Mousetrap.bind ('down', function() {SqueezeJS.Controller.setVolume(1, '-')});
    	Mousetrap.bind ('space', function() {SqueezeJS.Controller.playerControl(['pause'])});
    	Mousetrap.bind ('left', function() {SqueezeJS.Controller.playerControl(['playlist index -1'])});
    	Mousetrap.bind ('right', function() {SqueezeJS.Controller.playerControl(['playlist index +1'])});
    </script>
    The final two "playlist index" commands, however, do not work. I'm thinking it may not be a "SqueezeJS.Controller.playerControl" command, but I can't find any alternative. Any suggestions on how to correct this? Thanks.

  6. #6
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,530

    SqueezeJS.Controller.playerRequest([JSON formattedCLI request])

    > Mousetrap.bind ('left', function() {SqueezeJS.Controller.playerControl(['playlist index -1'])});
    > Mousetrap.bind ('right', function() {SqueezeJS.Controller.playerControl(['playlist index +1'])});
    >
    > The final two "playlist index" commands, however, do not work. I'm
    > thinking it may not be a "SqueezeJS.Controller.playerControl" command,
    > but I can't find any alternative. Any suggestions on how to correct
    > this? Thanks.


    Make the parameters separate elements of the list:

    ['playlist', 'index', '+1']


    --

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •