From 77636af8e7f7c17dc0aca7f8dec2467a015146b1 Mon Sep 17 00:00:00 2001 From: Yordan Suarez Date: Tue, 6 Dec 2022 11:58:45 -0500 Subject: [PATCH] stop using exception for no territory, instead assume main territory --- custom_components/fpl/fplapi.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/fpl/fplapi.py b/custom_components/fpl/fplapi.py index 3a9cd8c..9520e7a 100644 --- a/custom_components/fpl/fplapi.py +++ b/custom_components/fpl/fplapi.py @@ -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]