From 24e9c62fe76ea4eaa98321411c3aebdd36d45f67 Mon Sep 17 00:00:00 2001
From: Anders Melchiorsen <amelchio@nogoto.net>
Date: Thu, 27 Sep 2018 01:09:30 +0200
Subject: [PATCH] Upgrade pysonos to 0.0.3 (#16901)

This version has downgraded/removed some logging that we then no
longer have to hide.
---
 homeassistant/components/media_player/sonos.py | 8 --------
 homeassistant/components/sonos/__init__.py     | 2 +-
 requirements_all.txt                           | 2 +-
 requirements_test_all.txt                      | 2 +-
 4 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/homeassistant/components/media_player/sonos.py b/homeassistant/components/media_player/sonos.py
index fd735a5b830..1486d47e759 100644
--- a/homeassistant/components/media_player/sonos.py
+++ b/homeassistant/components/media_player/sonos.py
@@ -33,9 +33,7 @@ _LOGGER = logging.getLogger(__name__)
 
 # Quiet down pysonos logging to just actual problems.
 logging.getLogger('pysonos').setLevel(logging.WARNING)
-logging.getLogger('pysonos.events').setLevel(logging.ERROR)
 logging.getLogger('pysonos.data_structures_entry').setLevel(logging.ERROR)
-_SOCO_SERVICES_LOGGER = logging.getLogger('pysonos.services')
 
 SUPPORT_SONOS = SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE |\
     SUPPORT_PLAY | SUPPORT_PAUSE | SUPPORT_STOP | SUPPORT_SELECT_SOURCE |\
@@ -289,10 +287,6 @@ def soco_error(errorcodes=None):
             """Wrap for all soco UPnP exception."""
             from pysonos.exceptions import SoCoUPnPException, SoCoException
 
-            # Temporarily disable SoCo logging because it will log the
-            # UPnP exception otherwise
-            _SOCO_SERVICES_LOGGER.disabled = True
-
             try:
                 return funct(*args, **kwargs)
             except SoCoUPnPException as err:
@@ -302,8 +296,6 @@ def soco_error(errorcodes=None):
                     _LOGGER.error("Error on %s with %s", funct.__name__, err)
             except SoCoException as err:
                 _LOGGER.error("Error on %s with %s", funct.__name__, err)
-            finally:
-                _SOCO_SERVICES_LOGGER.disabled = False
 
         return wrapper
     return decorator
diff --git a/homeassistant/components/sonos/__init__.py b/homeassistant/components/sonos/__init__.py
index b4565794844..b794fe607e6 100644
--- a/homeassistant/components/sonos/__init__.py
+++ b/homeassistant/components/sonos/__init__.py
@@ -4,7 +4,7 @@ from homeassistant.helpers import config_entry_flow
 
 
 DOMAIN = 'sonos'
-REQUIREMENTS = ['pysonos==0.0.2']
+REQUIREMENTS = ['pysonos==0.0.3']
 
 
 async def async_setup(hass, config):
diff --git a/requirements_all.txt b/requirements_all.txt
index b84c0601c02..a954b2cf94f 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -1071,7 +1071,7 @@ pysma==0.2
 pysnmp==4.4.5
 
 # homeassistant.components.sonos
-pysonos==0.0.2
+pysonos==0.0.3
 
 # homeassistant.components.spc
 pyspcwebgw==0.4.0
diff --git a/requirements_test_all.txt b/requirements_test_all.txt
index 691fc641607..f33b37e01d1 100644
--- a/requirements_test_all.txt
+++ b/requirements_test_all.txt
@@ -169,7 +169,7 @@ pyotp==2.2.6
 pyqwikswitch==0.8
 
 # homeassistant.components.sonos
-pysonos==0.0.2
+pysonos==0.0.3
 
 # homeassistant.components.spc
 pyspcwebgw==0.4.0
-- 
GitLab