https://github.com/nbortolotti/arlocamservice
Project that aims to provide a set of services to interact with Arlo systems.
https://github.com/nbortolotti/arlocamservice
arlo flask-restful google-assistant python
Last synced: 9 months ago
JSON representation
Project that aims to provide a set of services to interact with Arlo systems.
- Host: GitHub
- URL: https://github.com/nbortolotti/arlocamservice
- Owner: nbortolotti
- Created: 2018-01-21T20:32:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T20:18:04.000Z (about 3 years ago)
- Last Synced: 2025-08-24T18:57:09.158Z (10 months ago)
- Topics: arlo, flask-restful, google-assistant, python
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Arlo Cam Service
Project that aims to provide a set of services to interact with
[Arlo](https://www.arlo.com) systems.
# Architecture
The project proposes an architecture based on App Engine Flexible environment.
The mechanism of interaction in Gunicorn and Flask
# UC covering webhook to response Google Assistant Agent action
```
def connect_tensor_xray():
try:
arlo = PyArlo('user', read_file("pass.txt")) # connect to pyarlo library
cam = arlo.cameras[2] # selecting cam
cam.schedule_snapshot() # take picture
time.sleep(3) # wait if is necesarry
r = requests.get("url_endpoint" + cam.snapshot_url)
return r
except Exception as e:
return [{"error"}]
@app.route('/arlo', methods=['POST'])
def tensor_photo():
try:
req = request.get_json(silent=True, force=True)
action = req.get('result').get('action')
# detect action from DialogFlow agent description.
if action == 'image.analysis':
tags = connect_tensor_xray() # method to use the integration to TensorPhotoXRay
for element in tags:
for key, value in element.iteritems():
if "dog" in key:
# Compose the response to API.AI
res = {'speech': 'Your pet is inside your house in the main room',
'displayText': 'Your pet is inside your house in the main room',
'contextOut': req['result']['contexts']}
else:
res = {'speech': 'nothing', 'displayText': 'nothing'}
final = make_response(jsonify(res))
return final
```