Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Update to use the new API. fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
peternijssen committed Oct 14, 2021
1 parent e963362 commit fde0b2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='spiderpy',
version='1.5.0',
version='1.6.0',
description='Python wrapper for the Spider API, a way to manage your Spider installation',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
8 changes: 6 additions & 2 deletions spiderpy/spiderapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from spiderpy.devices.powerplug import SpiderPowerPlug
from spiderpy.devices.thermostat import SpiderThermostat

BASE_URL = 'https://mijn.ithodaalderop.nl'
BASE_URL = 'https://spider-api.ithodaalderop.nl'

AUTHENTICATE_URL = BASE_URL + '/api/tokens'
DEVICES_URL = BASE_URL + '/api/devices'
Expand Down Expand Up @@ -261,9 +261,13 @@ def _request_login(self):
'X-Client-Library': 'SpiderPy'
}

hexStr = ''
for char in self._user:
hexStr += hex(ord(char)).lstrip('0x')

payload = {
'grant_type': 'password',
'username': self._user,
'username': hexStr,
'password': self._password
}

Expand Down

0 comments on commit fde0b2a

Please sign in to comment.