tchellomello / python-arlo

Python Arlo is a library written in Python 2.7/3x that exposes the Netgear Arlo cameras as Python objects.
GNU Lesser General Public License v3.0
100 stars 35 forks source link

Fix Mode Change (Arm/Disarm) #49

Closed jwillaz closed 7 years ago

jwillaz commented 7 years ago

Add caching of modes so they are not retrieved each time a change is called (reduces mode change from ~10 seconds to 3-4 seconds). Add checks for 'None' instances and make mode change generally more resilient.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 81.117% when pulling d32311245d0854befb8f991e4f4b00ee5379b2d6 on jwillaz:mode_change_fixes into 2d8b5357d1f299647da5c25f805f32fd8dfb2e63 on tchellomello:master.

tchellomello commented 7 years ago

Great idea on caching the data. I think part of the performance problem I had on HA 0.55 was related to that.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 81.117% when pulling 8cd1fef1cdc6e02db9ca85f3962759e6d1e77ed8 on jwillaz:mode_change_fixes into 2d8b5357d1f299647da5c25f805f32fd8dfb2e63 on tchellomello:master.

tchellomello commented 7 years ago

Thanks for your contribution @jwillaz

broox commented 7 years ago

Another way to do this may be to simply use the cached_property decorator. This may be useful for several other properties here as well...

https://github.com/pydanny/cached-property