stop using exception for no territory, instead assume main territory

This commit is contained in:
Yordan Suarez
2022-12-06 11:58:45 -05:00
parent 6c337e3c17
commit 77636af8e7

View File

@@ -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]