Skip to content

Commit

Permalink
Add 404 to api response that require authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
kbickar committed Mar 28, 2022
1 parent 1633cdc commit 616ed6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sense_energy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
from .plug_instance import PlugInstance
from .sense_link import SenseLink

__version__ = "0.10.3"
__version__ = "0.10.4"
4 changes: 2 additions & 2 deletions sense_energy/asyncsenseable.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ async def _api_call(self, url, payload={}):
async with self._client_session.get(
API_URL + url, headers=self.headers, timeout=timeout, data=payload
) as resp:
# check for 200 return
if resp.status == 401 or resp.status == 403:
# 4xx represents unauthenticated
if resp.status == 401 or resp.status == 403 or resp.status == 404:
raise SenseAuthenticationException(f"API Return Code: {resp.status}")

if resp.status != 200:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
'websockets;python_version>="3.5"',
'aiohttp;python_version>="3.5"',
],
version = '0.10.3',
version = '0.10.4',
description = 'API for the Sense Energy Monitor',
long_description=long_description,
long_description_content_type="text/markdown",
author = 'scottbonline',
author_email = '[email protected]',
url = 'https://github.com/scottbonline/sense',
download_url = 'https://github.com/scottbonline/sense/archive/0.10.3.tar.gz',
download_url = 'https://github.com/scottbonline/sense/archive/0.10.4.tar.gz',
keywords = ['sense', 'energy', 'api'],
classifiers = [
'Programming Language :: Python :: 2',
Expand Down

0 comments on commit 616ed6f

Please sign in to comment.