All Projects → benleb → surepy

benleb / surepy

Licence: MIT License
🐾 Library & CLI to monitor and control the Pet Door & Cat Flap Connect 🚪 the Pet Feeder Connect 🍽 and the Felaqua 💦 sold by Sure Petcare

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to surepy

Catpapers
Cool vision, learning, and graphics papers on Cats!
Stars: ✭ 918 (+1940%)
Mutual labels:  cats, cat
Cat Generator
Generate cat images with neural networks
Stars: ✭ 354 (+686.67%)
Mutual labels:  cats, cat
home assistant appdaemon alexa google
An AppDaemon application for Home Assistant, handles calls from Alexa Skill and a Google Action
Stars: ✭ 11 (-75.56%)
Mutual labels:  home-assistant, appdaemon
iocage-homeassistant
Home Assistant Core - TrueNAS CORE Community Plugin
Stars: ✭ 61 (+35.56%)
Mutual labels:  home-assistant, appdaemon
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (-33.33%)
Mutual labels:  home-assistant, appdaemon
Cat-Face-Detector-with-OpenCV-and-JavaFX
📹 A Small OpenCV (Open Source Computer Vision) Example, who has the ability to detect multiple cat faces at the same time 🐱
Stars: ✭ 24 (-46.67%)
Mutual labels:  cats, cat
addon-appdaemon
AppDaemon4 - Home Assistant Community Add-ons
Stars: ✭ 66 (+46.67%)
Mutual labels:  home-assistant, appdaemon
catmoji-colr
Twemoji, but with cats! Unicode 13.1! 🐱
Stars: ✭ 41 (-8.89%)
Mutual labels:  cats, cat
ha-config-ataraxis
My Home Assistant Configs. If you like what you see, please ⭐️my repo. It would encourage me a lot 🤘
Stars: ✭ 146 (+224.44%)
Mutual labels:  home-assistant, appdaemon
home
Monorepo for all home automation related development, including integrated firmware, PCBs, configuration, and bridges
Stars: ✭ 104 (+131.11%)
Mutual labels:  home-assistant, appdaemon
starcli
✨ Browse trending GitHub projects from your command line
Stars: ✭ 436 (+868.89%)
Mutual labels:  pypi
hass-shutter-card
Shutter card for Home Assistant Lovelace UI
Stars: ✭ 151 (+235.56%)
Mutual labels:  home-assistant
CatCode
猫猫码,一个可爱的通用特殊码,CQ码的精神延续。/ Cat code, the spirit of CQ code continues, a cute universal special code.
Stars: ✭ 23 (-48.89%)
Mutual labels:  cat
WindowsMonitor
WMI namespaces and classes
Stars: ✭ 15 (-66.67%)
Mutual labels:  monitor
django-admin-page-lock
Page Lock for Django Admin allows developers to implement customizable locking pages.
Stars: ✭ 13 (-71.11%)
Mutual labels:  pypi
mongo
Light-weight utilities and declarative schema (mutable mapping) to augment, not replace the Python MongoDB driver.
Stars: ✭ 18 (-60%)
Mutual labels:  pypi
vault4s
Vault Client Library For Scala
Stars: ✭ 15 (-66.67%)
Mutual labels:  cats
cookiecutter-pypackage
A cookiecutter template for Python package with heavy use of Github actions
Stars: ✭ 19 (-57.78%)
Mutual labels:  pypi
mc-monitor
Monitor the status of Minecraft servers and provides Prometheus exporter and Influx line protocol output
Stars: ✭ 100 (+122.22%)
Mutual labels:  monitor
ha-climacell-weather
Climacell weather provider integration is a custom component for Home Assistant. The climacell platform uses the Climacell API as a source for meteorological data for your location.
Stars: ✭ 41 (-8.89%)
Mutual labels:  home-assistant

surepy

Library & CLI to interact with the Sure Petcare API. surepy lets you monitor and control the Pet Door/Cat Flap Connect 🚪 and the Pet Feeder Connect 🍽 by Sure Petcare.


surepy features:

🔑 get an api token with your account credentials
🚪 lock/unlock a door or flap
🐾 get the location of pets & devices
🐈 get the state and more attributes of pets & devices
🕰️ get historic data & events of pets & devices
📬 get a list of (past) notifications

Getting Started

surepy is available via pypi.org

python3 -m pip install --upgrade surepy
# or
pip install --upgrade surepy

there is also a small cli available

$ surepy --help
Usage: surepy [OPTIONS] COMMAND [ARGS]...

  surepy cli 🐾

  https://github.com/benleb/surepy

Options:
  --version         show surepy version
  -j, --json        enable json api response output
  -t, --token TEXT  api token
  --help            Show this message and exit.

Commands:
  devices       get devices
  locking       lock control
  notification  get notifications
  pets          get pets
  position      set pet position
  report        get pet/household report
  token         get a token

the cli is mainly intended for developing & debugging purposes and probably has bugs - be careful 🐾

Library example

import asyncio

from os import environ
from pprint import pprint
from typing import Dict, List

from surepy import Surepy
from surepy.entities import SurepyEntity
from surepy.entities.devices import SurepyDevice
from surepy.entities.pet import Pet


async def main():

    # # user/password authentication (gets a token in background)
    # surepy = Surepy(email=user, password=password)

    # token authentication (token supplied via SUREPY_TOKEN env var)
    token = environ.get("SUREPY_TOKEN")
    surepy = Surepy(auth_token=token)

    # list with all pets
    pets: List[Pet] = await surepy.get_pets()
    for pet in pets:
        print(f"\n\n{pet.name}: {pet.state} | {pet.location}\n")
        pprint(pet.raw_data())

    print(f"\n\n - - - - - - - - - - - - - - - - - - - -\n\n")

    # all entities as id-indexed dict
    entities: Dict[int, SurepyEntity] = await surepy.get_entities()

    # list with alldevices
    devices: List[SurepyDevice] = await surepy.get_devices()
    for device in devices:
        print(f"{device.name = } | {device.serial = } | {device.battery_level = }")
        print(f"{device.type = } | {device.unique_id = } | {device.id = }")
        print(f"{entities[device.parent_id].full_name = } | {entities[device.parent_id] = }\n")


asyncio.run(main())

Naming confusion for surepetcarebeta users 🐾 🤪 🤦

Sorry for the bad naming and resulting confusion and chaos 🙄 To "fix" this, I renamed surepetcarebeta to sureha.

Name Repo Type Description Need Help?
surepy 🐾 github.com/benleb/surepy Python Library Library to interact with the API of Sure Petcare. Also provides Classes for the various Sure Petcare Devicess. Use this if you write an own python tool/app and want to interact with the Sure Petcare API Issues
surepetcare HA Favicon github.com/home-assistant/core Home Assistant Integration Official Home Assistant Integration for the Sure Petcare Devices like Doors, Flaps, Feeders, ... Issues, HA Forum
sureha surepetcarebeta benleb/surepetcare github.com/benleb/sureha Home Assistant Integration Home Assistant Integration developed in my own repo without reviews from the HA Team. This can be installed via HACS and is something like a preview integration for advanced users. Usually this provides more (experimental) features and faster fixes but lacks the code quality (reviews) and such from HA Issues
pethublocal github.com/plambrechtsen/pethublocal Home Assistant Integration Home Assistant Integration developed by @plambrechtsen which works completely independent from Sure Petcare. Check outs his repo for more information! Issues, HA Forum

Used by

Feel free to add you project!

Acknowledgments

Meta

Ben Lebherz: cat lover 🐾 developer & maintainer - @benleb | @ben_leb

This project is licensed under the MIT License - see the LICENSE file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].