Skip to main content

Python library for 2N® devices

Project description

Py2N

Asynchronous library to control 2N Telekomunikace® devices

This library is under development

Requirements

  • Python >= 3.9
  • aiohttp

Install

pip install py2n

Example

from py2n import Py2NDevice, Py2NConnectionData

import asyncio
import aiohttp

async def main():
    """Run with aiohttp ClientSession."""
    async with aiohttp.ClientSession() as session:
        await run(session)


async def run(websession):
    """Use library."""
    device = await Py2NDevice.create(
        websession,
        Py2NConnectionData(
            host="192.168.1.69",
            username="username",
            password="password",
        ),
    )

    await device.restart()

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py2n-0.4.0.tar.gz (6.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page