#24 API Token Support

This commit is contained in:
David Zingg
2020-07-01 21:25:06 +02:00
parent b3e53821bb
commit 7d80c84393
2 changed files with 9 additions and 9 deletions

View File

@ -180,6 +180,7 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
headers = {}
if self.token is not None and self.token != "":
headers = {"Token": self.token}
self._logger.info(headers)
request = requests.get(
'http://{}/report'.format(self.ip), headers=headers, timeout=1)
if request.status_code == 200: