Giter Site home page Giter Site logo

pyxows's Introduction

Cisco Telepresence XAPI over WebSockets, python library.

Python version required: 3.7 or newer.

Description

This library allows you to connect to a Cisco Telepresence endpoint running CE software version 9.7 or later using jsonrpc over websocket. There is also a command-line utility built on top of the library.

Installing

python setup.py install [--user]

Requirements

Websockets should be set to FollowHTTPService and HTTP Mode should be set to either HTTPS or HTTP/HTTPS.

Usage example

import xows
import asyncio

async def start():
    async with xows.XoWSClient('10.10.10.1', username='admin1', password='') as client:
        def callback(data, id_):
            print(f'Feedback (Id {id_}): {data}')

        print('Status Query:',
            await client.xQuery(['Status', '**', 'DisplayName']))

        print('Get:',
            await client.xGet(['Status', 'Audio', 'Volume']))

        print('Command:',
              await client.xCommand(['Audio', 'Volume', 'Set'], Level=60))

        print('Configuration:',
            await client.xSet(['Configuration', 'Audio', 'DefaultVolume'], 50))

        print('Subscription 0:',
            await client.subscribe(['Status', 'Audio', 'Volume'], callback, True))

        await client.wait_until_closed()

asyncio.run(start())

For more usage examples, check out the clixows script. It's source is found under xows/__main__.py and it can be invoked using python3 -m xows, or, after install, as clixows

Note that piping output from python scripts to other commands doesn't work well unless you switch to unbuffered output, so e.g. if you want timestamping using ts(1) you need to do e.g.

python3 -u -m xows my-endpoint feedback '**' | ts

pyxows's People

Contributors

hwdevops avatar xim avatar levensailor avatar

Watchers

James Cloos avatar

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.