power: add retries to custom http requests

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-03-29 15:39:04 -04:00
parent 8c7247acbb
commit b85f3081ab
No known key found for this signature in database
GPG Key ID: 7027245FBBDDF59A
1 changed files with 2 additions and 2 deletions

View File

@ -977,7 +977,7 @@ class SmartThings(HTTPDevice):
url = self.client.escape_url(url)
response = await self.client.request(
method, url, body=body, headers=headers,
enable_cache=False
attempts=3, enable_cache=False
)
msg = f"Error sending SmartThings command: {command}"
response.raise_for_status(msg)
@ -1052,7 +1052,7 @@ class HomeAssistant(HTTPDevice):
url = self.client.escape_url(url)
response = await self.client.request(
method, url, body=body, headers=headers,
enable_cache=False
attempts=3, enable_cache=False
)
msg = f"Error sending homeassistant command: {command}"
response.raise_for_status(msg)