Skip to content

Commit

Permalink
fixup: Format Python code with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
ngardiner committed May 16, 2024
1 parent 5c619a2 commit e5b76d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/TWCManager/EMS/TeslaPowerwall2.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ def getStormWatch(self):
products = list()

try:
r = self.httpSession.get(url, headers=headers, verify=carapi.verifyCert)
r = self.httpSession.get(
url, headers=headers, verify=carapi.verifyCert
)
r.raise_for_status()
bodyjson = r.json()
products = [
Expand Down Expand Up @@ -288,13 +290,17 @@ def getStormWatch(self):
bodyjson = None

try:
r = self.httpSession.get(url, headers=headers, verify=carapi.verifyCert)
r = self.httpSession.get(
url, headers=headers, verify=carapi.verifyCert
)
r.raise_for_status()
bodyjson = r.json()
lastData = bodyjson["response"]
except:
if r.status_code is 403:
logger.warn("Error fetching Powerwall cloud data; does your API token have energy_device_data scope?")
logger.warn(
"Error fetching Powerwall cloud data; does your API token have energy_device_data scope?"
)
pass

self.lastFetch[key] = (now, lastData)
Expand Down

0 comments on commit e5b76d8

Please sign in to comment.