Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update changelog docs #6

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,7 @@ jobs:
TOXENV: ${{ steps.toxenv.outputs.toxenv }}
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v2.2.3
with:
file: coverage.xml
debug: true
if: ${{ success() && matrix.python-version == '3.12' }}
779 changes: 1 addition & 778 deletions CHANGELOG.rst

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,20 @@ the install script above or pipx.

See `poetry documentation <https://python-poetry.org/>`_ for more info

Documentation
^^^^^^^^^^^^^

To build the docs install with the docs extra::

$ poetry install --extras docs

Then generate a `Github access token <https://github.com/settings/tokens/new?description=GitHub%20Changelog%20Generator%20token>`_
(no permissions are needed) and export it as follows::

$ export CHANGELOG_GITHUB_TOKEN="«your-40-digit-github-token»"

Then build::

$ make -C html

You can add the token to your shell profile to avoid having to export it each time. (e.g., .env, ~/.bash_profile, ~/.bashrc, ~/.zshrc, etc)
9 changes: 8 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
.. include:: ../../CHANGELOG.rst
=========
Changelog
=========

.. changelog::
:changelog-url: https://python-ring-doorbell.readthedocs.io/changelog.html
:github: https://github.com/tchellomello/python-ring-doorbell/releases/
:pypi: https://pypi.org/project/ring-doorbell/
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
from importlib.metadata import version as _version

# -- Project information -----------------------------------------------------
Expand All @@ -21,6 +22,7 @@
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"sphinx_github_changelog",
]

templates_path = ["_templates"]
Expand All @@ -31,3 +33,5 @@

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
master_doc = "index"
sphinx_github_changelog_token = os.environ.get("CHANGELOG_GITHUB_TOKEN")
3 changes: 3 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Welcome to python-ring-doorbell's documentation!
================================================


.. include:: ../../README.rst

.. toctree::
Expand All @@ -17,3 +18,5 @@ Welcome to python-ring-doorbell's documentation!
contributing
changelog



40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ asyncclick = ">=8"
anyio = "*" # see https://github.com/python-trio/asyncclick/issues/18
sphinx = {version = "<7.2.6", optional = true}
sphinx-rtd-theme = {version = "^1.3.0", optional = true}
sphinx-github-changelog = {version = "^1.2.1", optional = true}
firebase-messaging = {version = "^0.2.0", optional = true}

[tool.poetry.group.dev.dependencies]
Expand All @@ -58,15 +59,14 @@ pylint = "*"
pytest = "*"
pytest-cov = "*"
requests-mock = "*"
sphinx-github-changelog = "^1.2.1"
tox = "*"
pytest-asyncio = "*"
pytest-mock = "*"
black = "*"
pytest-socket = "^0.6.0"

[tool.poetry.extras]
docs = ["sphinx", "sphinx-rtd-theme"]
docs = ["sphinx", "sphinx-rtd-theme", "sphinx-github-changelog"]
listen = ["firebase-messaging"]

[tool.pytest.ini_options]
Expand Down Expand Up @@ -96,6 +96,10 @@ profile = "black"
known_first_party = "ring_doorbell"
known_third_party = ["asyncclick", "pytest"]

[tool.coverage.run]
source = ["ring_doorbell"]
branch = true

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 2 additions & 0 deletions ring_doorbell/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
)
from ring_doorbell.generic import RingGeneric
from ring_doorbell.group import RingLightGroup
from ring_doorbell.other import RingOther
from ring_doorbell.ring import Ring
from ring_doorbell.stickup_cam import RingStickUpCam

Expand All @@ -25,6 +26,7 @@
"RingStickUpCam",
"RingLightGroup",
"RingDoorBell",
"RingOther",
"RingEvent",
"RingError",
"AuthenticationError",
Expand Down
2 changes: 1 addition & 1 deletion ring_doorbell/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def query(
"timeout": timeout,
}

if method == "POST":
if method in ["POST", "PUT"]:
if json is not None:
kwargs["json"] = json
kwargs["headers"]["Content-Type"] = "application/json"
Expand Down
3 changes: 3 additions & 0 deletions ring_doorbell/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,16 @@ async def list_command(ring: Ring):
doorbells = devices["doorbots"]
chimes = devices["chimes"]
stickup_cams = devices["stickup_cams"]
other = devices["other"]

for device in doorbells:
echo(device)
for device in chimes:
echo(device)
for device in stickup_cams:
echo(device)
for device in other:
echo(device)


@cli.command()
Expand Down
18 changes: 18 additions & 0 deletions ring_doorbell/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class OAuth:
PERSIST_TOKEN_ENDPOINT = "/clients_api/device"
SUBSCRIPTION_ENDPOINT = "/clients_api/device"
GROUPS_ENDPOINT = "/groups/v1/locations/{0}/groups"
LOCATIONS_HISTORY_ENDPOINT = "/evm/v2/history/locations/{0}"
LOCATIONS_ENDPOINT = "/clients_api/locations/{0}"

HEALTH_DOORBELL_ENDPOINT = DOORBELLS_ENDPOINT + "/health"
HEALTH_CHIMES_ENDPOINT = CHIMES_ENDPOINT + "/health"
Expand All @@ -60,6 +62,11 @@ class OAuth:
URL_RECORDING_SHARE_PLAY = "/clients_api/dings/{0}/share/play"
GROUP_DEVICES_ENDPOINT = GROUPS_ENDPOINT + "/{1}/devices"
SETTINGS_ENDPOINT = "/devices/v1/devices/{0}/settings"
URL_INTERCOM_HISTORY = LOCATIONS_HISTORY_ENDPOINT + "?ringtercom"
INTERCOM_OPEN_ENDPOINT = "/commands/v1/devices/{0}/device_rpc"
INTERCOM_INVITATIONS_ENDPOINT = LOCATIONS_ENDPOINT + "/invitations"
INTERCOM_INVITATIONS_DELETE_ENDPOINT = LOCATIONS_ENDPOINT + "/invitations/{1}"
INTERCOM_ALLOWED_USERS = LOCATIONS_ENDPOINT + "/users"

# chime test sound kinds
KIND_DING = "ding"
Expand All @@ -73,6 +80,15 @@ class OAuth:
DOORBELL_VOL_MIN = 0
DOORBELL_VOL_MAX = 11

MIC_VOL_MIN = 0
MIC_VOL_MAX = 11

VOICE_VOL_MIN = 0
VOICE_VOL_MAX = 11

OTHER_DOORBELL_VOL_MIN = 0
OTHER_DOORBELL_VOL_MAX = 8

DOORBELL_EXISTING_TYPE = {0: "Mechanical", 1: "Digital", 2: "Not Present"}

SIREN_DURATION_MIN = 0
Expand Down Expand Up @@ -110,6 +126,8 @@ class OAuth:
STICKUP_CAM_GEN3_KINDS = ["cocoa_camera"]
BEAM_KINDS = ["beams_ct200_transformer"]

INTERCOM_KINDS = ["intercom_handset_audio"]

# error strings
MSG_BOOLEAN_REQUIRED = "Boolean value is required."
MSG_EXISTING_TYPE = "Integer value where {0}.".format(DOORBELL_EXISTING_TYPE)
Expand Down
Loading
Loading