Skip to main content

A Python library for Eufy Security devices

Project description

python-eufy-security

CI PyPi Version License Code Coverage Say Thanks

This is an experimental Python library for Eufy Security devices (cameras, doorbells, etc.).

Python Versions

The library is currently supported on

  • Python 3.6
  • Python 3.7
  • Python 3.8

Installation

pip install python-eufy-security

Account Information

Because of the way the Eufy Security private API works, an email/password combo cannot work with both the Eufy Security mobile app and this library. It is recommended to use the mobile app to create a secondary "guest" account with a separate email address and use it with this library.

Usage

Everything starts with an: aiohttp ClientSession:

import asyncio

from aiohttp import ClientSession


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
        # YOUR CODE HERE


asyncio.get_event_loop().run_until_complete(main())

Login and get to work:

import asyncio

from aiohttp import ClientSession

from eufy_security import async_login


async def main() -> None:
    """Create the aiohttp session and run the example."""
    async with ClientSession() as websession:
        # Create an API client:
        api = await async_login(EUFY_EMAIL, EUFY_PASSWORD, websession)

        # Loop through the cameras associated with the account:
        for camera in api.cameras.values():
            print("------------------")
            print("Camera Name: %s", camera.name)
            print("Serial Number: %s", camera.serial)
            print("Station Serial Number: %s", camera.station_serial)
            print("Last Camera Image URL: %s", camera.last_camera_image_url)

            print("Starting RTSP Stream")
            stream_url = await camera.async_start_stream()
            print("Stream URL: %s", stream_url)

            print("Stopping RTSP Stream")
            stream_url = await camera.async_stop_stream()


asyncio.get_event_loop().run_until_complete(main())

Check out example.py, the tests, and the source files themselves for method signatures and more examples.

Contributing

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. Install the dev environment: make init.
  4. Enter the virtual environment: source ./venv/bin/activate
  5. Code your new feature or bug fix.
  6. Write a test that covers your new functionality.
  7. Update README.md with any new documentation.
  8. Run tests and ensure 100% code coverage: make coverage
  9. Ensure you have no linting errors: make lint
  10. Ensure you have typed your code correctly: make typing
  11. Submit a pull request!

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

python-eufy-security-0.3.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

python_eufy_security-0.3.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file python-eufy-security-0.3.1.tar.gz.

File metadata

  • Download URL: python-eufy-security-0.3.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0b7 CPython/2.7.17 Darwin/19.3.0

File hashes

Hashes for python-eufy-security-0.3.1.tar.gz
Algorithm Hash digest
SHA256 55074e6ac07be20cb97573d1667fe710ef38343368855d181ad17ec5e084ddbb
MD5 e4529f321da9758e28cfb0ad2eb572e3
BLAKE2b-256 1bbd5f06496684b9229c220c66ac3e4e851c3b31b2d5d0b4ff1fb36d12f45308

See more details on using hashes here.

File details

Details for the file python_eufy_security-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_eufy_security-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2175fb2cdc3c8643599d6567de7ac2e7fb19a5739eb86cf766376734d59ea58
MD5 a8dea73c621d914c9eedf7a369d82364
BLAKE2b-256 9554bf36f1f0a18a4f75416832c6d63605335f65602b5ef912385e2e9c527992

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