Comments (6)
You don't need to directly invoke server_request
. All of the methods allowed by the interface are already mimic in pyhon code. For example, asuming the client object is named mopidy
you can just call:
mopidy.playback.next()
or mopidy.playback.previous()
. This is the preferred way since there is a little more code in between to assure the requests and responses are handled right.
from mopidy-json-client.
I understand better now how this project works!
I got another question, why get_time_position, get_current_tlid() and get_state() return always None?
Thanks a lot
from mopidy-json-client.
It appears like even tracklist get-methods returns always None.
Any suggestion?
from mopidy-json-client.
Yes, I think I know what it's going on.
Every call has a parameter timeout
, which can be passed on the function. It tells how many seconds to wait for a server response. The default value is now 0, so the function does not wait for the response and returns None
.
I will make a small change to the code to set the default value (if you don't specify any) to 20 seconds, so the calls work as it is. In the meantime, ¿could you set a timeout value on the calls to check that it works? Eg: get_current_tlid(timeout=20)
.
Another option is to use the parameter on_result=callback_function
, and the answer will be passed to the callback when it's ready. This is recommended specially for time-consuming calls but not required.
Thanks for the feedback.
from mopidy-json-client.
Fixed on version 0.5.14
from mopidy-json-client.
I tried to call all get-methods with timeout=20 and all works fine.
Thanks a lot.
from mopidy-json-client.
Related Issues (20)
- Mopidy API version selectable
- Error if calling a method inside a callback function
- Raise exception if no errorhandler HOT 1
- Raise TimeoutException HOT 1
- Upload GPIO volume example
- Improve Readme documentation HOT 1
- Ping connection with server HOT 1
- Extend connection status information
- Provide an event loop
- Improve threading management
- Don't expose Listener HOT 1
- Error while trying to launch demo_volume_gpio
- ImportError: No module named websocket HOT 3
- No modules_2_0 HOT 3
- No 'now playing' event on Pi Musicbox HOT 2
- Getting RequestTimeoutError after sending any command to mopidy
- error on adding Uris in tracklist
- Error reading responses mopidy 3.2
- mopidy-json-client don't work with mopidy 3.3.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mopidy-json-client.