mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Fix KeyError in rest (#92464)
This commit is contained in:
parent
9ce062411d
commit
603aa759d3
@ -67,7 +67,7 @@ async def async_setup_platform(
|
|||||||
if isinstance(rest.last_exception, ssl.SSLError):
|
if isinstance(rest.last_exception, ssl.SSLError):
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Error connecting %s failed with %s",
|
"Error connecting %s failed with %s",
|
||||||
conf[CONF_RESOURCE],
|
rest.url,
|
||||||
rest.last_exception,
|
rest.last_exception,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
@ -50,6 +50,11 @@ class RestData:
|
|||||||
self.last_exception: Exception | None = None
|
self.last_exception: Exception | None = None
|
||||||
self.headers: httpx.Headers | None = None
|
self.headers: httpx.Headers | None = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def url(self) -> str:
|
||||||
|
"""Get url."""
|
||||||
|
return self._resource
|
||||||
|
|
||||||
def set_url(self, url: str) -> None:
|
def set_url(self, url: str) -> None:
|
||||||
"""Set url."""
|
"""Set url."""
|
||||||
self._resource = url
|
self._resource = url
|
||||||
|
@ -71,7 +71,7 @@ async def async_setup_platform(
|
|||||||
if isinstance(rest.last_exception, ssl.SSLError):
|
if isinstance(rest.last_exception, ssl.SSLError):
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Error connecting %s failed with %s",
|
"Error connecting %s failed with %s",
|
||||||
conf[CONF_RESOURCE],
|
rest.url,
|
||||||
rest.last_exception,
|
rest.last_exception,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user