Giter Club home page Giter Club logo

aiosysbus's Introduction

aiosysbus

Manage your Livebox in Python

Easily manage your Livebox in Python. Check your config, configure your dhcp, disable your wifi, monitor your LAN activity and many others, on LAN or remotely.

aiosysbus is a python library implementing fir the Livebox v3.

This project is based on stilllman/aiofreepybox, which provides the same features as aiofreepybox in a synchronous manner.

WARNING

Version 1.0.0 and above makes all these calls asynchronously. It breaks the compatibility of previous codes

Install

Use the PIP package manager

$ pip install aiosysbus

Or manually download and install the last version from github

$ git clone https://github.com/cyr-ius/aiosysbus.git
$ python setup.py install

Get started

aiosysbus < 1.0.0

# Import the aiosysbus package.
from aiosysbus import AIOSysbus

async def reboot()
    # Instantiate the Sysbus class using default options.
    lvbx = AIOSysbus('192.168.1.1','80','xxxxxx')

    # Connect to the livebox with default options.
    lvbx.connect()

    # Do something useful, rebooting your livebox for example.
    lvbx.system.reboot()

    # Properly close the session.
    lvbx.close()

aiosysbus >= 1.0.0

import asyncio
import logging

async def async_main() -> None:
    # Instantiate the Sysbus class using default options.
    api = AIOSysbus(username=xxxx, password=xxxx, host=HOST)
    # Connect to the livebox.
    await api.async_connect()
    # Query example
    parameters = {"parameters": {"expression": {"wifi": "wifi && .Active==False"}}}
    devices = await api.devices.async_get_devices(parameters)

    await api.async_close()

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(async_main())

Have a look at the example.py for a more complete overview.

Notes on HTTPS

Not implemented

aiosysbus's People

Contributors

brenard avatar chpego avatar cyr-ius avatar dependabot[bot] avatar epenet avatar github-actions[bot] avatar hugoks3 avatar nardol avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

aiosysbus's Issues

Mode Asyncrhone - AIOSYSBUS

          Du coup, je te propose qu'on bascule nos échanges sur le repo aiosysbus.

https://github.com/cyr-ius/aiosysbus

De là , je fais une nouvelle branche que j'appel asyncio , je prépare l'api en mode asynchrone et un fichier example complet.

Ensuite , il te suffirait de lancer un python3.11 dans un venv , de faire un pip -r requirements.txt et de jouer le fichier example.py
Si il ne plante pas. On est bon , on a une API opérationnelle. On pourrait ainsi l'utiliser dans l'addon Livebox de Home Assistant

Originally posted by @cyr-ius in cyr-ius/hass-livebox-component#89 (comment)

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.