Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*__init__*
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ language: python
matrix:
fast_finish: true
include:
#- python: "3.4.2"
#env: TOXENV=py34
- python: "2.7"
env: TOXENV=py27
- python: "3.5"
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36
- python: "3.4.2"
env: TOXENV=lint
#- python: "3.5"
# env: TOXENV=py35
#- python: "3.6"
# env: TOXENV=py36
install: pip install -U tox coveralls
script: tox
cache: pip
after_success: coveralls
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In [12]: mydoorbell.
mydoorbell.account_id mydoorbell.kind
mydoorbell.address mydoorbell.last_recording_id
mydoorbell.battery_life mydoorbell.latitude
mydoorbell.check_activity mydoorbell.live_streaming_json
mydoorbell.check_alerts mydoorbell.live_streaming_json
mydoorbell.debug mydoorbell.longitude
mydoorbell.existing_doorbell_type mydoorbell.name
mydoorbell.existing_doorbell_type_duration mydoorbell.recording_download
Expand Down Expand Up @@ -84,4 +84,4 @@ Out[17]: False
- A guy named MadBagger at Prism19 for his initial research (http://www.prism19.com/doorbot/second-pass-and-comm-reversing/)
- The creators of mitmproxy (https://mitmproxy.org/) great http and https traffic inspector
- @mfussenegger for his post on mitmproxy and virtualbox https://zignar.net/2015/12/31/sniffing-vbox-traffic-mitmproxy/

- To the project http://www.android-x86.org/ which allowed me to install Android on KVM.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = PythonRingDoorBell
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
158 changes: 158 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Python Ring Door Bell documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 13 05:17:01 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../ring_doorbell/'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Python Ring Door Bell'
copyright = '2017, Marcelo Moreira de Mello'
author = 'Marcelo Moreira de Mello'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1.1'
# The full version, including alpha/beta/rc tags.
release = '0.1.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'PythonRingDoorBelldoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'PythonRingDoorBell.tex',
'Python Ring Door Bell Documentation',
'Marcelo Moreira de Mello', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pythonringdoorbell', 'Python Ring Door Bell Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'PythonRingDoorBell', 'Python Ring Door Bell Documentation',
author, 'PythonRingDoorBell', 'One line description of project.',
'Miscellaneous'),
]
9 changes: 9 additions & 0 deletions docs/source/credits.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Credits && Thanks
-----------------

* This project was inspired and based on https://github.com/jeroenmoors/php-ring-api. Many thanks @jeroenmoors.
* A guy named MadBagger at Prism19 for his initial research (http://www.prism19.com/doorbot/second-pass-and-comm-reversing/)
* The creators of mitmproxy (https://mitmproxy.org/) great http and https traffic inspector
* @mfussenegger for his post on mitmproxy and virtualbox https://zignar.net/2015/12/31/sniffing-vbox-traffic-mitmproxy/
* To the project http://www.android-x86.org/ which allowed me to install Android on KVM.

91 changes: 91 additions & 0 deletions docs/source/how_to.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
How To Use It
=============

Initializing your Ring object
-----------------------------

.. code-block:: python

from ring_doorbell import Ring
myring = Ring('foo@bar', 'secret')

myring.is_connected
True

myring.has_subscription
True

Chimes
------

Listing devices linked to your account
------------------------------------------

.. code-block:: python

# All devices
myring.devices
{'chimes': [<RingChime: Downstairs>],
'doorbells': [<RingDoorBell: Front Door>]}

# All chimes
myring.chimes
[<RingChime: Downstairs>]

# All door bells
myring.doorbells
[<RingDoorBell: Front Door>]

Getting/setting attributes
--------------------------------
.. code-block:: python

for dev in list(myring.chimes + myring.doorbells):

# refresh data
dev.update()

print('Account ID: %s' % dev.account_id)
print('Address: %s' % dev.address)
print('Family: %s' % dev.family)
print('ID: %s' % dev.id)
print('Name: %s' % dev.name)
print('Timezone: %s' % dev.timezone)

# setting dev volume
print('Volume: %s' % dev.volume)
dev.volume = 5
print('Volume: %s' % dev.volume)

# play dev test shound
if dev.family == 'chimes'
dev.test_sound


Showing door bell events
------------------------
.. code-block:: python

for doorbell in myring.doorbells:

# listing the last 15 events of any kind
for event in doorbell.history(limit=15):
print('ID: %s' % event['id'])
print('Kind: %s' % event['kind'])
print('Answered: %s' % event['answered'])
print('When: %s' % event['created_at'])
print('--' * 50)

# get a event list only the triggered by motion
events = doorbell.history(kind='motion')


Download the last video triggerd by ding
----------------------------------------
.. code-block:: python

doorbell = myring.doorbells[0]
doorbell.recording_download(
doorbell.history(limit=100, kind='ding')[0]['id'],
filename='/home/user/last_ding.mp4',
override=True)
29 changes: 29 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
=================================================
Python Ring Door Bell's documentation
=================================================

Python Ring Door Bell is a library written in Python 2.7/3x
that exposes the Ring.com devices as Python objects.


.. note::
Ring.com does not provide an official API.
The results of this project are merely from reverse engineering.


.. toctree::
:maxdepth: 2
:caption: Contents:

Installation <installation.rst>
How to Use it <how_to.rst>
Source Code <source_code.rst>
Credits & Thanks <credits.rst>

Indices and tables
==================

* :ref:`genindex`
* :ref:`search`

.. _Python Ring DoorBell: https://github.com/tchellomello/python-ring-doorbell
13 changes: 13 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Installation
------------

.. code-block:: bash

# Installing from PyPi
$ pip install ring_doorbell #python 2.7
$ pip3 install ring_doorbell #python 3.x

# Installing latest development
$ pip3 install \
git+https://github.com/tchellomello/python-ring-doorbell@dev

Loading