![]() ![]() You can then initialize a server and start using commands: # get the server office = mcws. get_media_server ( "AccessKey", "readonly", "supersecretpassword" ) # use a recipe to play an album files = office. query_album ( "Ludovico Einaudi", "I Giorni" ) office. zones () for zone in zones : print ( zone. playpause ( zones )įor a full set of examples, please see examples.py. Pymcws wraps the MCWS API in a 1:1 manner. If you are looking for then that's located under. This way, you can import API functions to your scripts as needed. ![]() To call these functions, you need a server. The easiest way to get one is to call pymcws.get_media_server() along with an access key, username and password. The server returned in this way already imports the API functions and provides them locally. These two calls are functionally identical: # get the server office. If you intend to use the second option exclusively, consider using pymcws.get_media_server_light() to get your server - the returned class does not import API functions directly. ![]() The general philosophy of pymcws is to make communication with mcws as easy as possible. The behaviour if the API has been replicated 1:1, where exceptions exist, they are documented. The main difference is that pymcws provides classes that model complex entities like zones and files, and uses theseĬlasses to facilitate interaction. More on these classes in the following sections.įinally, pymcws provides convenience methods that enable users to quickly execute common tasks. Stored in pymcws.recipes and contain functionality like playing and querying albums. The MediaServer class covers all functionality to communicate with JRiver Media Center. The most important feature is connection negotiation. Inside your home network, this will be the local IP, When providing an access key, the server is resolved,Īnd the best connection strategy is chosen. Pymcws queries these field definitions and automatically performs type conversions for them, allowing users JRiver Media Center has a complex model for files and allows adding custom fields with varying types. To work with common types like string, int, float, datetime etc. When saving changes to files, the types are converted back to jriver-compatible versions.įiles themselves are simply (extended) dictionaries. Calling my_file returns the datetime of the corresponding field. ![]()
0 Comments
Leave a Reply. |