stop using exception for no territory, instead assume main territory
This commit is contained in:
@@ -26,10 +26,6 @@ _LOGGER = logging.getLogger(__package__)
|
||||
URL_TERRITORY = API_HOST + "/cs/customer/v1/territoryid/public/territory"
|
||||
|
||||
|
||||
class NoTerrytoryAvailableException(Exception):
|
||||
"""Thrown when not possible to determine user territory"""
|
||||
|
||||
|
||||
class FplApi:
|
||||
"""A class for getting energy usage information from Florida Power & Light."""
|
||||
|
||||
@@ -58,7 +54,7 @@ class FplApi:
|
||||
|
||||
territoryArray = json_data["data"]["territory"]
|
||||
if len(territoryArray) == 0:
|
||||
raise NoTerrytoryAvailableException()
|
||||
return FPL_MAINREGION
|
||||
|
||||
self._territory = territoryArray[0]
|
||||
return territoryArray[0]
|
||||
|
||||
Reference in New Issue
Block a user