Skip to content

Commit

Permalink
refactor: remove TZ exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezza34000 committed Nov 28, 2024
1 parent fc06a48 commit 9bc5c1b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions custom_components/petkit/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import async_timeout

from petkit_api import PetKitClient
from petkit_api.exceptions import AuthError, PetKitError, RegionError, ServerError, TimezoneError
from petkit_api.exceptions import AuthError, PetKitError, RegionError, ServerError

from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
Expand All @@ -29,10 +29,6 @@ async def async_validate_api(hass: HomeAssistant, email: str, password: str, reg
except AuthError as err:
LOGGER.error(f'Could not authenticate on PetKit servers: {err}')
raise AuthError(err)
except TimezoneError:
error = 'A timezone could not be found. If you are running Home Assistant as a standalone Docker container, you must define the TZ environmental variable. If the TZ variable is defined or you are running Home Assistant OS, your timezone was not found in the tzlocal library - Please manually select a timezone during setup.'
LOGGER.error(f'{error}')
raise TimezoneError(error)
except ServerError as err:
LOGGER.error(f'PetKit servers are busy.Please try again later.')
raise ServerError(err)
Expand Down

0 comments on commit 9bc5c1b

Please sign in to comment.