A Python library for Eufy Security devices
Project description
python-eufy-security
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
Installation
TBD
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
- Check for open features/bugs or initiate a discussion on one.
- Fork the repository.
- Install the dev environment:
make init
. - Enter the virtual environment:
pipenv shell
- Code your new feature or bug fix.
- Write a test that covers your new functionality.
- Run tests and ensure 100% code coverage:
make coverage
- 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
Built Distribution
Hashes for python-eufy-security-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 360dcecdbaa32b4e49c2f99159873006088c68702d189404a6dc3d7f949fc696 |
|
MD5 | a26d078a17101cb0f60947d870c27859 |
|
BLAKE2b-256 | 5e5c65ce9811497803631c33865b255580ce58dea176610a8359f36100466ebf |
Hashes for python_eufy_security-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8bf8eeb6ae58d1431e62ec88c9bac483c295dd7417be61d4be77f67775af0f |
|
MD5 | c0681daaf42980b640e792010d283722 |
|
BLAKE2b-256 | 19712ad0deb5c5d625149dd0a9f5c2bcd01cb4ed2d4aa18ef361fa3d1d537a82 |