Skip to main content

Beward Client

Project description

Please :star: this repo if you find it useful

py-beward

PyPI version PyPI Python version Maintained

Project Maintenance Support me on Patreon

Python API for Beward Cameras and Doorbells. This is used in Home Assistant component but should be generic enough that can be used elsewhere.

Installation

pip install beward

Usage example

Discovery devices:

from beward import Beward


for dev in Beward.discovery().values():
    print(f"Found device \"{dev.name}\" at http://{dev.host_ip}:{dev.http_port}")

Initialize one device and listen for events:

import time

from beward import Beward
from beward.const import ALARM_ONLINE, ALARM_MOTION, ALARM_SENSOR


def handler(device, timestamp, alarm, state):
    print('Handling alarm "%s". State: %d' % (alarm, state))


DEVICE_HOST = '192.168.1.100'
DEVICE_USER = 'admin'
DEVICE_PASS = 'password'

bwd = Beward.factory(DEVICE_HOST, DEVICE_USER, DEVICE_PASS, stream=1)
bwd.add_alarms_handler(handler)
bwd.listen_alarms(alarms=(ALARM_ONLINE, ALARM_MOTION, ALARM_SENSOR))

print('Live image URL:', bwd.live_image_url)
print('RTSP live video URL:', bwd.rtsp_live_video_url)
print('Live image:', bwd.camera_image())

for decade in range(10):
    print('Time: %ds' % (decade * 10))
    time.sleep(10)
print('Bye')

Contributions are welcome!

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! :heart_eyes:

Authors & contributors

The original setup of this library is by Andrey "Limych" Khrolenok.

For a full list of all authors and contributors, check the contributor's page.

This project was created and is updated using the Py-Blueprint template. You can use this template to maintain your own projects.

License

creative commons Attribution-NonCommercial-ShareAlike 4.0 International License

See separate license file for full text.

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

beward-1.1.13.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

beward-1.1.13-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file beward-1.1.13.tar.gz.

File metadata

  • Download URL: beward-1.1.13.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for beward-1.1.13.tar.gz
Algorithm Hash digest
SHA256 dda16113f1411ad1ab02c2cca223f4f539e0cc974cbfa0b1aca646e50c0b1454
MD5 bbb6c19836bfc75921a940420fb69f9b
BLAKE2b-256 b91c3237259bff1ecdb4b1b96f581d8cd935fa40dfc3ba1944c14b88971353cb

See more details on using hashes here.

File details

Details for the file beward-1.1.13-py3-none-any.whl.

File metadata

  • Download URL: beward-1.1.13-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for beward-1.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 4dafd136aa37aada3a90860cb273553d2bd42ac8a24b8465bc9386d3603f7384
MD5 3558dec55f28ae387d1554692fe1bd72
BLAKE2b-256 d7e60de73391640dc009c59044a883ba8cbc638be5b97d917f851ec155a6c5d0

See more details on using hashes here.

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