Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Base Station Mode enhancements #40

Merged
merged 4 commits into from
Sep 22, 2017
Merged

Conversation

broox
Copy link
Collaborator

@broox broox commented Sep 21, 2017

This makes a change to pull all available modes from the Arlo API and also adds the ability to set custom modes on the Arlo base station.

I tested this on my personal Arlo pro setup and was able to set both the predefined and my custom defined modes.

@coveralls
Copy link

coveralls commented Sep 21, 2017

Coverage Status

Coverage increased (+7.4%) to 62.375% when pulling 4bcc657 on broox:modes into 846fd50 on tchellomello:master.

@@ -134,7 +134,7 @@ def __run_action(
"""
url = NOTIFY_ENDPOINT.format(self.device_id)

body = ACTION_BODY
body = ACTION_BODY.copy()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my tests, this was inadvertently mutating the original ACTION_BODY dict between requests. Copying it to a local variable prevents that.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense!! Good catch!

@tchellomello tchellomello self-assigned this Sep 22, 2017
@tchellomello tchellomello added this to the 0.0.7 milestone Sep 22, 2017
@tchellomello
Copy link
Owner

@broox Good job !!! Thanks for your contribution!!

@tchellomello tchellomello merged commit f246314 into tchellomello:master Sep 22, 2017
tchellomello added a commit that referenced this pull request Sep 26, 2017
* Added Sphinx documentation (#23)

* Added Sphinx documentation

* Exclude flake8 from docs directory

* Added developer documentation link to README.rst

* Added support for getting the mode and also battery_level from device (#22)

* Added code to create an event stream and get notifications from arlo device. This can be used to get mode, battery level of camera and even all other properties of camera. Created properties to pull the base station properties, camera properties, schedule, rules etc. Also added property to get the battery level of cameras as well as filled the mode getter function to return the mode.

* Added code to create an event stream and get notifications from arlo device. This can be used to get mode, battery level of camera and even all other properties of camera. Created properties to pull the base station properties, camera properties, schedule, rules etc. Also added property to get the battery level of cameras as well as filled the mode getter function to return the mode.

* Updating the requirements.txt to add sseclient

* Updating the requirements.txt to add sseclient-py

* Updating the setup.py to add sseclient-py

* Addressing the review comments by @tchellomello

* Addressing the comments posted by CI bot

* Added code to get the per camera battery level. Added a new property called get_battery_level for camera. It will return the battery level of that camera alone.

* Fixing the review comment by CI bot. Also updated the README file with the commands to get properties, battery level, mode etc

* Added new properties for base station and camera. Added property in base station to fetch the schedule and a boolean property to find out if motion detection is enabled or not. Added properties in camera to get flip, mirror, power save mode, connection status, signal strength etc.

* Added property in camera to fetch the motion detection sensitivity

* Added property in camera to fetch the motion detection sensitivity : fixed the lint errors.

* Updated README with new properties

* Bump version 0.0.5

* Bump dev version 0.0.6

* Fix basestation mode property for custom mode settings. (#28)

* Fix basestation mode property for custom mode settings.
Bump version.

* Correct pylint issue... extra else.

* Address comments.

* Address pylint issue. Seems linelength restriction, impairs clarity here.

* Address pylint issue with linelength.

* Unittests (#26)

* Initiated skeleton for unittests

* Added Python 3.4 on travis

* Fixed coverage link

* Expanding unit test coverage (#29)

* Added tests for pyarlo.utils

* Added tests for http_stream on pyarlo.utils

* Added tests for pyarlo.camera

* Fixed mock_open() function (#30)

* Fixed mock_open() function

* Remove any temporary file created by unit tests

* Optimization: Instead of subscribing for each query, user can subscribe once and then post query (#32)

* Optimization: Instead of subscribing, starting a new thread and then posting query for getting info from base for each and every query, user can subscribe once in the beginning and then just ask the query, get response.

* Changed a info LOGGER into debug LOGGER. This was spamming the HASS output with query request/response

* Remove raise_for_status() since it can create problems with async functions

* Arlo Optimizations & New property to get camera signal strength (#34)

* Optimizations for improving the speed/time of subscribing and waiting for event. Earlier it used to be 5 seconds for each subscribe and getting event. This new model allows client applications using this library to just subscribe first, and then just query for information. This saves time in getting the info needed to barely 0.7 seconds. Removed the while loop to wait for an event, and using the threading event concept. Also added a new property to get the signal strength as a dictionary.

* Updated the code to use the get function get the element instead of directly accessing it by its key. This will protect from exception if that key is not present for some reason.

* Use the get function to get the element instead of directly accessing. This will take care of any exceptions thus raised in case that element is not in the dict

* Added a check for None in case we didn't get the modes response within our timeout period.

* Operator == always will return bool

* Make lint happy

* Bump dev version 0.0.7

* Base Station Mode enhancements (#40)

* add a test for the current mode property

* add the ability to set custom modes

* linted

* update READMEs

* Tests and a bit of cleanup (#42)

* add base station tests

* add more camera tests and fix a couple small bugs

* try using binary file reading

* explicitly read binary files as such. test camera.live_streaming

* linting

* Fixed merge

* Fixed merge via webUI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants