power: add retries to custom http requests
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
8c7247acbb
commit
b85f3081ab
|
@ -977,7 +977,7 @@ class SmartThings(HTTPDevice):
|
||||||
url = self.client.escape_url(url)
|
url = self.client.escape_url(url)
|
||||||
response = await self.client.request(
|
response = await self.client.request(
|
||||||
method, url, body=body, headers=headers,
|
method, url, body=body, headers=headers,
|
||||||
enable_cache=False
|
attempts=3, enable_cache=False
|
||||||
)
|
)
|
||||||
msg = f"Error sending SmartThings command: {command}"
|
msg = f"Error sending SmartThings command: {command}"
|
||||||
response.raise_for_status(msg)
|
response.raise_for_status(msg)
|
||||||
|
@ -1052,7 +1052,7 @@ class HomeAssistant(HTTPDevice):
|
||||||
url = self.client.escape_url(url)
|
url = self.client.escape_url(url)
|
||||||
response = await self.client.request(
|
response = await self.client.request(
|
||||||
method, url, body=body, headers=headers,
|
method, url, body=body, headers=headers,
|
||||||
enable_cache=False
|
attempts=3, enable_cache=False
|
||||||
)
|
)
|
||||||
msg = f"Error sending homeassistant command: {command}"
|
msg = f"Error sending homeassistant command: {command}"
|
||||||
response.raise_for_status(msg)
|
response.raise_for_status(msg)
|
||||||
|
|
Loading…
Reference in New Issue