Skip to content

Commit

Permalink
Deactivate UPnP when device not available
Browse files Browse the repository at this point in the history
  • Loading branch information
fwestenberg committed Dec 24, 2024
1 parent f24243e commit 15f0aa8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions devialet/devialet_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,12 @@ async def _async_get_request(self, suffix: str) -> any | None:
except aiohttp.ClientConnectorError as conn_err:
LOGGER.debug("Host %s: Connection error %s", self._host, str(conn_err))
self._is_available = False
self._upnp_device = None
return None
except asyncio.TimeoutError:
LOGGER.debug("Devialet connection timeout exception. Please check the connection")
self._is_available = False
LOGGER.debug(
"Devialet connection timeout exception. Please check the connection"
)
self._upnp_device = None
return None
except (TypeError, json.JSONDecodeError):
LOGGER.debug("Devialet: JSON error")
Expand Down Expand Up @@ -580,8 +580,8 @@ async def async_upnp_play(self) -> None:

try:
await set_uri.async_call(InstanceID=0, Speed=1)
return True
return
except UpnpActionResponseError:
return False
return
except UpnpXmlParseError:
return False
return

0 comments on commit 15f0aa8

Please sign in to comment.