Skip to content

Commit

Permalink
fix: unsupported temp error (#87)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cdnninja and pre-commit-ci[bot] authored Sep 5, 2024
1 parent e1f7f34 commit 28d4aa2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions yoto_api/YotoAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,16 @@ def update_players(self, token: Token, players: list[YotoPlayer]) -> None:
players[deviceId].system_volume = get_child_value(
player_status_response, "systemVolumePercentage"
)
if int(get_child_value(player_status_response, "temperatureCelcius")) != 0:
players[deviceId].temperature_celcius = get_child_value(
player_status_response, "temperatureCelcius"
)
if isinstance(
get_child_value(player_status_response, "temperatureCelcius"), int
):
if (
int(get_child_value(player_status_response, "temperatureCelcius"))
!= 0
):
players[deviceId].temperature_celcius = get_child_value(
player_status_response, "temperatureCelcius"
)
players[deviceId].bluetooth_audio_connected = get_child_value(
player_status_response, "isBluetoothAudioConnected"
)
Expand Down

0 comments on commit 28d4aa2

Please sign in to comment.