From 20ded56c99196c3d047140c777d5d28cfa2fe105 Mon Sep 17 00:00:00 2001
From: Assaf Akrabi <akrabi@users.noreply.github.com>
Date: Wed, 11 Sep 2024 16:48:20 +0300
Subject: [PATCH] Bump russound to 0.2.0 (#125743)

* Update russound library to fix BrokenPipeError

* Remove library from license expection list
---
 homeassistant/components/russound_rnet/manifest.json   | 2 +-
 homeassistant/components/russound_rnet/media_player.py | 8 +++++++-
 requirements_all.txt                                   | 2 +-
 script/licenses.py                                     | 1 -
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/homeassistant/components/russound_rnet/manifest.json b/homeassistant/components/russound_rnet/manifest.json
index a93e3fe5a87..90bf5d5a7f3 100644
--- a/homeassistant/components/russound_rnet/manifest.json
+++ b/homeassistant/components/russound_rnet/manifest.json
@@ -5,5 +5,5 @@
   "documentation": "https://www.home-assistant.io/integrations/russound_rnet",
   "iot_class": "local_polling",
   "loggers": ["russound"],
-  "requirements": ["russound==0.1.9"]
+  "requirements": ["russound==0.2.0"]
 }
diff --git a/homeassistant/components/russound_rnet/media_player.py b/homeassistant/components/russound_rnet/media_player.py
index a08cfbe7747..f8369ed64ca 100644
--- a/homeassistant/components/russound_rnet/media_player.py
+++ b/homeassistant/components/russound_rnet/media_player.py
@@ -96,7 +96,13 @@ class RussoundRNETDevice(MediaPlayerEntity):
         # Updated this function to make a single call to get_zone_info, so that
         # with a single call we can get On/Off, Volume and Source, reducing the
         # amount of traffic and speeding up the update process.
-        ret = self._russ.get_zone_info(self._controller_id, self._zone_id, 4)
+        try:
+            ret = self._russ.get_zone_info(self._controller_id, self._zone_id, 4)
+        except BrokenPipeError:
+            _LOGGER.error("Broken Pipe Error, trying to reconnect to Russound RNET")
+            self._russ.connect()
+            ret = self._russ.get_zone_info(self._controller_id, self._zone_id, 4)
+
         _LOGGER.debug("ret= %s", ret)
         if ret is not None:
             _LOGGER.debug(
diff --git a/requirements_all.txt b/requirements_all.txt
index 9f2582bfd95..0ff67e3f696 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -2546,7 +2546,7 @@ rpi-bad-power==0.1.0
 rtsp-to-webrtc==0.5.1
 
 # homeassistant.components.russound_rnet
-russound==0.1.9
+russound==0.2.0
 
 # homeassistant.components.ruuvitag_ble
 ruuvitag-ble==0.1.2
diff --git a/script/licenses.py b/script/licenses.py
index ac9a836396c..347362dec16 100644
--- a/script/licenses.py
+++ b/script/licenses.py
@@ -160,7 +160,6 @@ EXCEPTIONS = {
     "pyvera",  # https://github.com/maximvelichko/pyvera/pull/164
     "pyxeoma",  # https://github.com/jeradM/pyxeoma/pull/11
     "repoze.lru",
-    "russound",  # https://github.com/laf/russound/pull/14   # codespell:ignore laf
     "ruuvitag-ble",  # https://github.com/Bluetooth-Devices/ruuvitag-ble/pull/10
     "sensirion-ble",  # https://github.com/akx/sensirion-ble/pull/9
     "sharp_aquos_rc",  # https://github.com/jmoore987/sharp_aquos_rc/pull/14
-- 
GitLab