Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #115 #116

Merged
merged 1 commit into from Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/emonhub_interfacer.py
Expand Up @@ -252,9 +252,9 @@ def _send_post(self, post_url, post_body=None):
else:
reply = requests.get(post_url)
reply.raise_for_status() # Raise an exception if status code isn't 200
return reply.text
except requests.exceptions.RequestException as ex:
self._log.warning(self.name + " couldn't send to server: " + str(ex))
return reply.text

def _process_rx(self, cargo):
"""Process a frame of data
Expand Down
4 changes: 2 additions & 2 deletions src/interfacers/EmonHubEmoncmsHTTPInterfacer.py
Expand Up @@ -70,10 +70,10 @@ def _process_post(self, databuffer):

reply = self._send_post(post_url, {'data': data_string, 'sentat': str(sentat)})
if reply == 'ok':
self._log.debug("acknowledged receipt with '" + reply + "' from " + self._settings['url'])
self._log.debug("acknowledged receipt with '%s' from %s", reply, self._settings['url'])
return True
else:
self._log.warning("send failure: wanted 'ok' but got '" + reply + "'")
self._log.warning("send failure: wanted 'ok' but got '%s'", reply)
return False

def sendstatus(self):
Expand Down