Skip to content

Commit f65f773

Browse files
committed
fix: raising TionException fixed
1 parent 20934d9 commit f65f773

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

tion_btle/lite.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def create_request_params_command() -> bytearray:
171171
if self.have_breezer_state:
172172
result = self._data
173173
else:
174-
raise TionException("Could not get breezer state")
174+
raise TionException("Lite _get_data_from_breezer", "Could not get breezer state")
175175

176176
return result
177177

@@ -202,7 +202,9 @@ def _decode_response(self, response: bytearray):
202202
# self._max_fan = data[54]
203203
# self._heater_percent = data[55]
204204
except IndexError as e:
205-
raise TionException("Got bad response from Tion '%s': %s while parsing" % (response, str(e)))
205+
raise TionException(
206+
"Lite _decode_response", "Got bad response from Tion '%s': %s while parsing" % (response, str(e))
207+
)
206208

207209
def _generate_model_specific_json(self) -> dict:
208210
return {

tion_btle/s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_status_command() -> bytearray:
9393
result = self._data
9494

9595
else:
96-
raise TionException("Could not get breezer state")
96+
raise TionException("s3 _get_data_from_breezer", "Could not get breezer state")
9797

9898
return result
9999

@@ -117,7 +117,7 @@ def _decode_response(self, response: bytearray):
117117
self._fw_version = "{:02x}{:02x}".format(response[18], response[17])
118118

119119
except IndexError as e:
120-
raise TionException("Got bad response from Tion '%s': %s while parsing" % (response, str(e)))
120+
raise TionException("s3 _decode_response", "Got bad response from Tion '%s': %s while parsing" % (response, str(e)))
121121

122122
def _generate_model_specific_json(self) -> dict:
123123
return {

0 commit comments

Comments
 (0)