Skip to content

Commit

Permalink
Update & switch to using surepy (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
therefromhere authored Sep 10, 2022
1 parent 8c0dab8 commit 57b267f
Show file tree
Hide file tree
Showing 14 changed files with 1,186 additions and 934 deletions.
15 changes: 10 additions & 5 deletions .gcloudignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
.git
.gitignore

# pycharm
.idea
# First ignore everything
.*

# Now include the files we want
!requirements.txt
!main.py
!sureflap_gcloud/*.py

# Explicitly allow current dir. `gcloud deploy` fails without it.
!.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Project specific
requirements.txt
.env_vars.yaml

# ------------
Expand Down
695 changes: 21 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sureflap_gcloud

A Google Cloud function to talk to the SureFlap cat flap API using [rcastberg's sure_petcare python library](https://github.com/rcastberg/sure_petcare)
A Google Cloud function to talk to the SureFlap cat flap API using [benleb's surepy python library](https://github.com/benleb/surepy)

## To run locally for testing

Expand Down
3 changes: 0 additions & 3 deletions deploy.sh

This file was deleted.

11 changes: 6 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import flask
import logging

import flask
import sureflap_gcloud


def update(request: flask.Request):
"""
Google cloud function entrypoint
:param request:
:return:
"""
logging.basicConfig()
logging.getLogger().setLevel(logging.INFO)

retval = {"status": "ok"}

sureflap_gcloud.update_firestore_cache()
sureflap_gcloud.set_curfew()

return flask.jsonify(retval)
Loading

0 comments on commit 57b267f

Please sign in to comment.