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
- 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
- Check for open features/bugs or initiate a discussion on one.
- Fork the repository.
- Install the dev environment:
make init
. - Enter the virtual environment:
source ./venv/bin/activate
- Code your new feature or bug fix.
- Write a test that covers your new functionality.
- Update
README.md
with any new documentation. - Run tests and ensure 100% code coverage:
make coverage
- Ensure you have no linting errors:
make lint
- Ensure you have typed your code correctly:
make typing
- Submit a pull request!
Project details
Release history Release notifications | RSS feed
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-rik-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16b21af5a11a537fafa731cdd1342fffebb1e5433463652e1b6c19ec2ec95ed6 |
|
MD5 | 3b5c3873227dbdb36aab9d4b874a1adf |
|
BLAKE2b-256 | d29e7b16e833890871a44108c15831c1469cb3de2f5c81c22e6932aa877c6fd9 |
Hashes for python_eufy_security_rik-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c1279224ad2129474e8500d3c9f43bc280b52cd775b5f5956127a5f98246774 |
|
MD5 | 271b644e77a16ff0de50c6941da064d5 |
|
BLAKE2b-256 | e599187e1891aeaf6ba11d7388562c17b3910c79e3d75d15b2e3a2f3bb0636c4 |