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"
|
URL_TERRITORY = API_HOST + "/cs/customer/v1/territoryid/public/territory"
|
||||||
|
|
||||||
|
|
||||||
class NoTerrytoryAvailableException(Exception):
|
|
||||||
"""Thrown when not possible to determine user territory"""
|
|
||||||
|
|
||||||
|
|
||||||
class FplApi:
|
class FplApi:
|
||||||
"""A class for getting energy usage information from Florida Power & Light."""
|
"""A class for getting energy usage information from Florida Power & Light."""
|
||||||
|
|
||||||
@@ -58,7 +54,7 @@ class FplApi:
|
|||||||
|
|
||||||
territoryArray = json_data["data"]["territory"]
|
territoryArray = json_data["data"]["territory"]
|
||||||
if len(territoryArray) == 0:
|
if len(territoryArray) == 0:
|
||||||
raise NoTerrytoryAvailableException()
|
return FPL_MAINREGION
|
||||||
|
|
||||||
self._territory = territoryArray[0]
|
self._territory = territoryArray[0]
|
||||||
return territoryArray[0]
|
return territoryArray[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user