mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Use pynzbgetapi exceptions consistently (#26667)
This commit is contained in:
parent
f45f8f2f3d
commit
719a601880
@ -3,7 +3,6 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
import pynzbgetapi
|
import pynzbgetapi
|
||||||
import requests
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -101,6 +100,6 @@ class NZBGetData:
|
|||||||
self.status = self._api.status()
|
self.status = self._api.status()
|
||||||
self.available = True
|
self.available = True
|
||||||
dispatcher_send(self.hass, DATA_UPDATED)
|
dispatcher_send(self.hass, DATA_UPDATED)
|
||||||
except requests.exceptions.ConnectionError:
|
except pynzbgetapi.NZBGetAPIException:
|
||||||
self.available = False
|
self.available = False
|
||||||
_LOGGER.error("Unable to refresh NZBGet data")
|
_LOGGER.error("Unable to refresh NZBGet data")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user