From d8e1836d183f82781c57178a7165a0cb09efd16b Mon Sep 17 00:00:00 2001 From: jdeath <17914369+jdeath@users.noreply.github.com> Date: Tue, 20 Sep 2022 17:21:50 -0400 Subject: [PATCH] Add files via upload --- custom_components/hubspace/hubspace.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/hubspace/hubspace.py b/custom_components/hubspace/hubspace.py index 0ae9b03..0be9253 100644 --- a/custom_components/hubspace/hubspace.py +++ b/custom_components/hubspace/hubspace.py @@ -324,9 +324,16 @@ def getDebugInfo(self,child): _LOGGER.debug(json.dumps(r.json(), indent=4, sort_keys=True)) _LOGGER.debug("############ End Dump #########") + token = self.getAuthTokenFromRefreshToken() auth_url = "https://api2.afero.net/v1/accounts/" + self._accountId + "/metadevices/" + child + "/state" + auth_header = { + "user-agent": "Dart/2.15 (dart:io)", + "host": "semantics2.afero.net", + "accept-encoding": "gzip", + "authorization": "Bearer " + token, + } + auth_data = {} - headers = {} r = requests.get(auth_url, data=auth_data, headers=auth_header) r.close()