Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 7 of 7
  1. #1

    LMSTools - python library for Logitech Media Server

    Previously, I used the PyLMS library (which is excellent) but I found that there some was some functionality missing. As a result, I ended up having to add my own code to get the desired outcome and I thought that I should try to put it all together into a library. The end result is my LMSTools library.

    The main differences from PyLMS are:
    • Server and Player objects use the JSON interface rather than telnet (no need to maintain a persistent connection)
    • Add a callback server to handle asynchronous callback from server events
    • Adds the ability to generate squeezeplayer menus (for designing your own interface)


    There is more detailed documentation available here: http://lmstools.readthedocs.io/

    The library is available to download from here: https://github.com/elParaguayo/LMSTools

    Any bugs, enhancement requests etc. can be posted here on the github issues tracker.

    I hope it's of some use for your own projects. Enjoy!

  2. #2
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,184
    Interesting project.
    You say you use JSON/RPC for the server communication but that's not how you build that custom menu, isn't it?
    How do you do that?
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  3. #3
    Yes. The menu is retrieved by sending a json command. The module interprets the response and turns it into menu item objects.

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

    LMSTools - python library for Logitech MediaServer

    > Yes. The menu is retrieved by sending a json command. The module
    > interprets the response and turns it into menu item objects.


    TBH I was confused about this, too. I think what you're doing in the
    library actually belongs in the application specific space: you're
    taking a menu definition and transform it into something _your_
    application will understand. But for the library I'd just leave the meu
    definition as it is, and leave it to the application to figure out what
    it wants to do with it.

    But other than that I think it's great to see some more work for Python,
    as it's clearly becoming more and more popular (thanks Pi!)

    --

    Michael

  5. #5
    Michael,

    That's not an unfair comment!

    What I was trying to do was convert the response into the separate menu items and provide a means to access the relevant actions in a way that would be familiar to python coders, instead of having them trying to interpret the raw json response themselves.

    Obviously, the way I did this was based on how I wanted to use it in my own applications.

    Users don't have to use this module if they don't want to!

    If you think it should be done differently then I'd certainly consider changing the code.

  6. #6
    Senior Member pippin's Avatar
    Join Date
    Oct 2007
    Location
    Berlin
    Posts
    14,184
    Ah, ok, that's what confused me.
    So your custom menus are only delivered to applications using your library, not to all controllers/devices connected to LMS, right?
    So you just change the data the library delivers, you don't change the menus as managed by LMS ?
    ---
    learn more about iPeng, the iPhone and iPad remote for the Squeezebox and
    Logitech UE Smart Radio as well as iPeng Party, the free Party-App,
    at penguinlovesmusic.com
    New: iPeng 9, the Universal App for iPhone, iPad and Apple Watch

  7. #7
    I should probably make it clearer in the docs. You can control the players without using the menu module. It's sole purpose is to help create a user interface.

Posting Permissions

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