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

0.22.4 #830

Merged
merged 57 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
53c6394
dev bump
fronzbot Nov 5, 2023
cc5ba7c
Bump ruff from 0.1.3 to 0.1.4
dependabot[bot] Nov 6, 2023
a50ed5f
Merge pull request #806 from fronzbot/dependabot/pip/ruff-0.1.4
fronzbot Nov 7, 2023
2269178
Bump ruff from 0.1.4 to 0.1.5
dependabot[bot] Nov 9, 2023
6699e12
Merge pull request #810 from fronzbot/dependabot/pip/ruff-0.1.5
fronzbot Nov 10, 2023
15d080b
Bump black from 23.10.1 to 23.11.0
dependabot[bot] Nov 10, 2023
daea3cf
Merge pull request #808 from fronzbot/dependabot/pip/black-23.11.0
fronzbot Nov 10, 2023
cbdf7c2
Bump ruff from 0.1.5 to 0.1.6
dependabot[bot] Nov 17, 2023
2d8219e
python formatter
Rosi2143 Nov 18, 2023
7ed8d9c
Merge pull request #812 from fronzbot/dependabot/pip/ruff-0.1.6
fronzbot Nov 19, 2023
9fa0f86
Merge pull request #813 from Rosi2143/formating_changes
fronzbot Nov 19, 2023
b0c4e6d
Create .readthedocs.yaml
fronzbot Nov 19, 2023
68fbd5f
Update .readthedocs.yaml
fronzbot Nov 19, 2023
9b89f9e
Update .readthedocs.yaml
fronzbot Nov 19, 2023
8d568db
Merge pull request #816 from fronzbot/fronzbot-patch-1
fronzbot Nov 19, 2023
ffe5e70
Create requirements.txt
fronzbot Nov 19, 2023
a6c4fa6
Update .readthedocs.yaml
fronzbot Nov 19, 2023
c3f899e
Update requirements.txt
fronzbot Nov 19, 2023
13d2258
Update .readthedocs.yaml
fronzbot Nov 19, 2023
731a554
Update .readthedocs.yaml
fronzbot Nov 19, 2023
12dc6b7
Update conf.py
fronzbot Nov 19, 2023
917485e
Update conf.py
fronzbot Nov 19, 2023
e587f92
Update conf.py
fronzbot Nov 19, 2023
8b06e0f
Update conf.py
fronzbot Nov 19, 2023
2df02e0
Update conf.py
fronzbot Nov 19, 2023
a9c7c40
Update conf.py
fronzbot Nov 19, 2023
ad72078
Delete ReadTheDocs
fronzbot Nov 19, 2023
00f196e
Delete .readthedocs.yaml
fronzbot Nov 19, 2023
725f9ee
Update README.rst
fronzbot Nov 19, 2023
8bfa75b
Merge pull request #817 from fronzbot/shit-dont-work
fronzbot Nov 19, 2023
aea3ca3
Bump pygments from 2.16.1 to 2.17.1
dependabot[bot] Nov 20, 2023
e78bf87
docstring format changes
Rosi2143 Nov 20, 2023
27423ed
add missing entry in type_key_map
Rosi2143 Nov 20, 2023
8de7720
Merge pull request #822 from Rosi2143/docstring_changes
fronzbot Nov 20, 2023
32f3235
Merge pull request #819 from fronzbot/dependabot/pip/pygments-2.17.1
fronzbot Nov 20, 2023
dd8a5a2
Add kwargs to throttled functions
mkmer Nov 22, 2023
be6ab89
throttle sleep
mkmer Nov 22, 2023
70fccf6
remove extra execution
mkmer Nov 22, 2023
1056276
Fix lint errors
mkmer Nov 22, 2023
5715261
revert changeds to throttle
mkmer Nov 22, 2023
6ac7d5b
Add delay to throttle
mkmer Nov 22, 2023
d79ff7f
Lint errors
mkmer Nov 22, 2023
5f3b5ef
Increase Timeout
mkmer Nov 22, 2023
e311066
Bump pygments from 2.17.1 to 2.17.2
dependabot[bot] Nov 22, 2023
71facfb
remove tests
mkmer Nov 22, 2023
b4edc64
Bump ruff from 0.1.6 to 0.1.7
dependabot[bot] Dec 5, 2023
d1cdfe6
Merge pull request #821 from Rosi2143/type_key_map
fronzbot Dec 5, 2023
744c211
Merge pull request #824 from fronzbot/dependabot/pip/pygments-2.17.2
fronzbot Dec 5, 2023
53f9d83
Merge pull request #825 from fronzbot/dependabot/pip/ruff-0.1.7
fronzbot Dec 5, 2023
a884161
Merge pull request #823 from mkmer/allow-kwargs-to-throttled-functions
fronzbot Dec 6, 2023
a96d5a1
Bump black from 23.11.0 to 23.12.0
dependabot[bot] Dec 12, 2023
ff3d812
Bump ruff from 0.1.7 to 0.1.8
dependabot[bot] Dec 14, 2023
0714a24
Merge pull request #827 from fronzbot/dependabot/pip/black-23.12.0
fronzbot Dec 18, 2023
587c383
Merge branch 'dev' into dependabot/pip/ruff-0.1.8
fronzbot Dec 18, 2023
ed44cbd
Merge pull request #828 from fronzbot/dependabot/pip/ruff-0.1.8
fronzbot Dec 18, 2023
f383b90
Update CHANGES.rst
fronzbot Dec 18, 2023
30dce56
Update pyproject.toml
fronzbot Dec 18, 2023
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
18 changes: 18 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ Changelog

A list of changes between each release

0.22.4 (2023-12-18)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Bugfixes**

- Allow kwargs to throttled functions, await sleep in throttle (`mkmer #823 <https://github.com/fronzbot/blinkpy/pull/800>`__)
- add missing entry in type_key_map (`@Rosi2143 <https://github.com/fronzbot/blinkpy/pull/813>`__)

** Other Changes **

- Delete ReadTheDocs
- python formatter
- docstring format changes
- Bump ruff to 0.1.8
- Bump black to 23.12.0
- Bump pygments to 2.17.2


0.22.3 (2023-11-05)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
5 changes: 1 addition & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
blinkpy |Build Status| |Coverage Status| |Docs| |PyPi Version| |Codestyle|
blinkpy |Build Status| |Coverage Status| |PyPi Version| |Codestyle|
=============================================================================================
A Python library for the Blink Camera system (Python 3.8+)

Expand Down Expand Up @@ -39,7 +39,6 @@ To install the current development version, perform the following steps. Note t

If you'd like to contribute to this library, please read the `contributing instructions <https://github.com/fronzbot/blinkpy/blob/dev/CONTRIBUTING.rst>`__.

For more information on how to use this library, please `read the docs <https://blinkpy.readthedocs.io/en/latest/>`__.

Purpose
-------
Expand Down Expand Up @@ -249,7 +248,5 @@ API steps
:target: https://codecov.io/gh/fronzbot/blinkpy
.. |PyPi Version| image:: https://img.shields.io/pypi/v/blinkpy.svg
:target: https://pypi.python.org/pypi/blinkpy
.. |Docs| image:: https://readthedocs.org/projects/blinkpy/badge/?version=latest
:target: http://blinkpy.readthedocs.io/en/latest/?badge=latest
.. |Codestyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
46 changes: 27 additions & 19 deletions blinkpy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def request_syncmodule(blink, network):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_system_arm(blink, network):
async def request_system_arm(blink, network, **kwargs):
"""
Arm system.

Expand All @@ -148,7 +148,7 @@ async def request_system_arm(blink, network):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_system_disarm(blink, network):
async def request_system_disarm(blink, network, **kwargs):
"""
Disarm system.

Expand Down Expand Up @@ -177,14 +177,14 @@ async def request_command_status(blink, network, command_id):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_homescreen(blink):
async def request_homescreen(blink, **kwargs):
"""Request homescreen info."""
url = f"{blink.urls.base_url}/api/v3/accounts/{blink.account_id}/homescreen"
return await http_get(blink, url)


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_sync_events(blink, network):
async def request_sync_events(blink, network, **kwargs):
"""
Request events from sync module.

Expand All @@ -196,7 +196,7 @@ async def request_sync_events(blink, network):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_new_image(blink, network, camera_id):
async def request_new_image(blink, network, camera_id, **kwargs):
"""
Request to capture new thumbnail for camera.

Expand All @@ -211,7 +211,7 @@ async def request_new_image(blink, network, camera_id):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_new_video(blink, network, camera_id):
async def request_new_video(blink, network, camera_id, **kwargs):
"""
Request to capture new video clip.

Expand All @@ -226,7 +226,7 @@ async def request_new_video(blink, network, camera_id):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_video_count(blink):
async def request_video_count(blink, **kwargs):
"""Request total video count."""
url = f"{blink.urls.base_url}/api/v2/videos/count"
return await http_get(blink, url)
Expand Down Expand Up @@ -304,14 +304,14 @@ async def request_camera_sensors(blink, network, camera_id):

:param blink: Blink instance.
:param network: Sync module network id.
:param camera_id: Camera ID of camera to request sesnor info from.
:param camera_id: Camera ID of camera to request sensor info from.
"""
url = f"{blink.urls.base_url}/network/{network}/camera/{camera_id}/signals"
return await http_get(blink, url)


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_motion_detection_enable(blink, network, camera_id):
async def request_motion_detection_enable(blink, network, camera_id, **kwargs):
"""
Enable motion detection for a camera.

Expand All @@ -326,8 +326,9 @@ async def request_motion_detection_enable(blink, network, camera_id):


@Throttle(seconds=MIN_THROTTLE_TIME)
async def request_motion_detection_disable(blink, network, camera_id):
"""Disable motion detection for a camera.
async def request_motion_detection_disable(blink, network, camera_id, **kwargs):
"""
Disable motion detection for a camera.

:param blink: Blink instance.
:param network: Sync module network id.
Expand All @@ -340,7 +341,8 @@ async def request_motion_detection_disable(blink, network, camera_id):


async def request_local_storage_manifest(blink, network, sync_id):
"""Update local manifest.
"""
Update local manifest.

Request creation of an updated manifest of video clips stored in
sync module local storage.
Expand All @@ -360,7 +362,8 @@ async def request_local_storage_manifest(blink, network, sync_id):


async def get_local_storage_manifest(blink, network, sync_id, manifest_request_id):
"""Request manifest of video clips stored in sync module local storage.
"""
Request manifest of video clips stored in sync module local storage.

:param blink: Blink instance.
:param network: Sync module network id.
Expand All @@ -377,7 +380,8 @@ async def get_local_storage_manifest(blink, network, sync_id, manifest_request_i


async def request_local_storage_clip(blink, network, sync_id, manifest_id, clip_id):
"""Prepare video clip stored in the sync module to be downloaded.
"""
Prepare video clip stored in the sync module to be downloaded.

:param blink: Blink instance.
:param network: Sync module network id.
Expand All @@ -400,7 +404,8 @@ async def request_local_storage_clip(blink, network, sync_id, manifest_id, clip_


async def request_get_config(blink, network, camera_id, product_type="owl"):
"""Get camera configuration.
"""
Get camera configuration.

:param blink: Blink instance.
:param network: Sync module network id.
Expand All @@ -427,7 +432,8 @@ async def request_get_config(blink, network, camera_id, product_type="owl"):
async def request_update_config(
blink, network, camera_id, product_type="owl", data=None
):
"""Update camera configuration.
"""
Update camera configuration.

:param blink: Blink instance.
:param network: Sync module network id.
Expand Down Expand Up @@ -455,7 +461,8 @@ async def request_update_config(
async def http_get(
blink, url, stream=False, json=True, is_retry=False, timeout=TIMEOUT
):
"""Perform an http get request.
"""
Perform an http get request.

:param url: URL to perform get request.
:param stream: Stream response? True/FALSE
Expand All @@ -474,9 +481,10 @@ async def http_get(


async def http_post(blink, url, is_retry=False, data=None, json=True, timeout=TIMEOUT):
"""Perform an http post request.
"""
Perform an http post request.

:param url: URL to perfom post request.
:param url: URL to perform post request.
:param is_retry: Is this part of a re-auth attempt?
:param data: str body for post request
:param json: Return json response? TRUE/False
Expand Down
6 changes: 3 additions & 3 deletions blinkpy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, login_data=None, no_prompt=False, session=None):
- username
- password
:param no_prompt: Should any user input prompts
be supressed? True/FALSE
be suppressed? True/FALSE
"""
if login_data is None:
login_data = {}
Expand Down Expand Up @@ -152,8 +152,8 @@ async def query(
is_retry=False,
timeout=TIMEOUT,
):
"""Perform server requests."""
"""
"""Perform server requests.

:param url: URL to perform request
:param data: Data to send
:param headers: Headers to send
Expand Down
13 changes: 8 additions & 5 deletions blinkpy/blinkpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
Useful for preventing motion_detected property
from de-asserting too quickly.
:param no_owls: Disable searching for owl entries (blink mini cameras \
only known entity). Prevents an uneccessary API call \
only known entity). Prevents an unnecessary API call \
if you don't have these in your network.
"""
self.auth = Auth(session=session)
Expand Down Expand Up @@ -101,7 +101,7 @@ async def refresh(self, force=False, force_cache=False):
# Prevents rapid clearing of motion detect property
self.last_refresh = int(time.time())
last_refresh = datetime.datetime.fromtimestamp(self.last_refresh)
_LOGGER.debug(f"last_refresh={last_refresh}")
_LOGGER.debug("last_refresh = %s", last_refresh)

return True
return False
Expand All @@ -128,8 +128,9 @@ async def start(self):
# Initialize last_refresh to be just before the refresh delay period.
self.last_refresh = int(time.time() - self.refresh_rate * 1.05)
_LOGGER.debug(
f"Initialized last_refresh to {self.last_refresh} == "
f"{datetime.datetime.fromtimestamp(self.last_refresh)}"
"Initialized last_refresh to %s == %s",
self.last_refresh,
datetime.datetime.fromtimestamp(self.last_refresh),
)

return await self.setup_post_verify()
Expand Down Expand Up @@ -167,12 +168,13 @@ async def setup_sync_module(self, name, network_id, cameras):
await self.sync[name].start()

async def get_homescreen(self):
"""Get homecreen information."""
"""Get homescreen information."""
if self.no_owls:
_LOGGER.debug("Skipping owl extraction.")
self.homescreen = {}
return
self.homescreen = await api.request_homescreen(self)
_LOGGER.debug("homescreen = %s", util.json_dumps(self.homescreen))

async def setup_owls(self):
"""Check for mini cameras."""
Expand Down Expand Up @@ -234,6 +236,7 @@ async def setup_camera_list(self):
response = await api.request_camera_usage(self)
try:
for network in response["networks"]:
_LOGGER.info("network = %s", util.json_dumps(network))
camera_network = str(network["network_id"])
if camera_network not in all_cameras:
all_cameras[camera_network] = []
Expand Down
Loading
Loading