Giter VIP home page Giter VIP logo

lmstools's People

Contributors

elparaguayo avatar keesma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lmstools's Issues

Unable to obtain player power state

I was unable to identify a property for the player power state. Have managed to work around by adding the following into player.py:

@property
def power(self):
	"""
	Player power state.
	
	:getter: retrieve power state of player
	:rtype: bool
	:returns: True if on, False if off
	
	:setter: set power state of player on server(True = On)
	
	"""
	
	if self.parse_request("power ?", "_power") == "1":
		return True
	else:
		return False

@power.setter
def power(self, power):
	try:
		if power == True:
			self.request("power {}".format("1"))
		elif power == False:
			self.request("power {}".format("0"))
		self._power = power
	except:
		pass

2to3 works, but breaks actual functionality

I was super excited to find this code. It's exactly what I need for an ePaper/Rasperry Pi SqueezeBox that I'm building.

Is there any chance you are going to continue to maintain this and move it to Python 3?

I tried to migrate it to python 3, but failed miserably. The python 3 urllib2->urllib mess breaks something deep within the guts.

I haven't had the pythonFu to figure out what goes wrong, but the symptoms are pretty interesting:

server = LMSServer('media-server.local')
print(server.get_player_count())
>>> 0

The same code run under python2 works just fine. Clearly something's busted.

LMSPlayer errors when attempting to connect to player that is not conneced to server

When attempting to use the LMSPlayer class directly with a MAC address that is not connected on the Logitech Media Server the following error occurs:

LMSTools/LMSTools/player.py", line 121, in parse_request
return self.request(command).get(key)
AttributeError: 'NoneType' object has no attribute 'get'

I have been able to resolve this by checking if the self.request(command) is None before attempting the attribute get(key):

    rcommand = self.request(command)
    if rcommand == None:
    	return None
    else:
     return rcommand.get(key)

However think this could be better resolved by checking if the player is present on the server during init

Change Playlist ?

Hi, thanks for the work you did on this project. It is very well done & documented. Is it possible to to interrupt the current playlist, play a song then revert back to the original playlist?

I want to integrate LMSTools into Domoticz and make an announcement when some event has happened. For example it's 10 pm and the garage is open or someone is ringing the door bell.

I have all my announcements in a playlist & I just need to select the particular song to play then I want to revert the squeezebox back to where & what it was doing before the announcement.

thanks

LMSServer.show_players_sync_status()

why wouldn't this return a list of player instances rather then the names and MACs?
and could player.get_synced_players() (optionally) also return the number of the sync group, assuming that is a static number.

How to add an album to a playlist

Hi,

I tried to add an album to an playlist, which worked, but not with non-ascii-characters in the name....

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os, sys


from LMSTools import LMSServer

# Define your server address
SERVER_IP = "192.168.120.4"

# create the server object
server = LMSServer(SERVER_IP)

# get the attached players
players = server.get_players()

# print players

sl = server.get_players()[1]

print sl

# sl.stop()
sl.play()

# Works :)
sl.request('playlist loadalbum * Metallica Load')
# Both do not work:
# sl.request('playlist loadalbum * Der%20Grüffelo Der%20Grüffelo')
# sl.request('playlist loadalbum * Der Grüffelo Der Grüffelo')

Any hints?

Thx,

ramon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.