Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

eyesoft/pybuspro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7dc6686 · Sep 7, 2022

History

82 Commits
Sep 10, 2018
Sep 14, 2018
Dec 29, 2021
Dec 29, 2021
Mar 21, 2022
Aug 1, 2022
Sep 5, 2018
Sep 5, 2018
Sep 7, 2022
Jan 25, 2022
Jan 25, 2022

Repository files navigation

pybuspro - A Buspro Library Written in Python

This repository has been archived. Go to https://github.com/eyesoft/home_assistant_buspro/.

Documentation

See documentation at: https://github.com/eyesoft/pybuspro/docs/.

Home-Assistant Plugin

pybuspro contains a Plugin for the Home-Assistant automation plattform.

Installation

pip3 install pybuspro

Example

"""Example for switching a light on and off."""
import asyncio

from pybuspro.buspro import Buspro
from pybuspro.devices.light import Light

GATEWAY_ADDRESS_SEND_RECEIVE = (('127.0.0.1', 6000), ('', 6000))


def callback_all_messages(telegram):
    print(telegram)
    pass
    
    
async def main():
    """Connect to Buspro bus, switch on light, wait 2 seconds and switch of off again."""
    buspro = Buspro(GATEWAY_ADDRESS_SEND_RECEIVE)
    # buspro.register_telegram_received_cb_2(callback_all_messages)
    await buspro.start()
    
    light = Light(buspro, device_address=(1, 100), channel_number=9, name="name of light")
    await light.set_on()
    await asyncio.sleep(2)
    await light.set_off()
    
    # await buspro.disconnect()


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.run_forever()

About

Python Buspro API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages