-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing MQTT stuff from this branch
- Loading branch information
Eric George
committed
Jul 3, 2017
1 parent
b1ae076
commit d944f29
Showing
4 changed files
with
26 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import requests | ||
|
||
from config import PUMP_ENDPOINT, TEMP_ENDPOINT, AUTH, logger | ||
|
||
def post_data(endpoint, data): | ||
|
||
try: | ||
r = requests.post(endpoint, data, auth=AUTH) | ||
except: | ||
logger.error('Requests error publishing data') | ||
else: | ||
if r.status_code != 200: | ||
logger.error('Http error publishing data: {0}'\ | ||
.format(r.status_code)) | ||
return r | ||
|
||
def post_temp(**data): | ||
return post_data(TEMP_ENDPOINT, data) | ||
|
||
def post_pump(**data): | ||
return post_data(PUMP_ENDPOINT, data) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.