Skip to content

Handle timeouts in Sonos, reduce logging noise#85461

Merged
bdraco merged 1 commit into
home-assistant:devfrom
jjlawren:sonos/timeouts-and-logging
Jan 8, 2023
Merged

Handle timeouts in Sonos, reduce logging noise#85461
bdraco merged 1 commit into
home-assistant:devfrom
jjlawren:sonos/timeouts-and-logging

Conversation

@jjlawren
Copy link
Copy Markdown
Contributor

@jjlawren jjlawren commented Jan 8, 2023

Proposed change

Handles connection timeouts in addition to connection failures/rejections. Also reduces noisiness in logging as discussed in this comment.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Jan 8, 2023

Hey there @cgtobi, mind taking a look at this pull request as it has been labeled with an integration (sonos) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sonos can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign sonos Removes the current integration label and assignees on the issue, add the integration domain after the command.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 8, 2023

Testing this now by having 4 of them on, turning them off, and restarting HA with this merged in

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 8, 2023

Much quieter now for the ones I turned off

2023-01-08 23:36:51.050 WARNING (SyncWorker_6) [homeassistant.components.sonos] Failed to add SonosSpeaker using <SoCo object at ip 192.168.106.180>: HTTPConnectionPool(host='192.168.106.180', port=1400): Max retries exceeded with url: /xml/device_description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1441e68e20>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2023-01-08 23:36:54.071 WARNING (SyncWorker_6) [homeassistant.components.sonos] Failed to add SonosSpeaker using <SoCo object at ip 192.168.106.207>: HTTPConnectionPool(host='192.168.106.207', port=1400): Max retries exceeded with url: /xml/device_description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f144413d840>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2023-01-08 23:36:57.204 WARNING (SyncWorker_6) [homeassistant.components.sonos] Failed to add SonosSpeaker using <SoCo object at ip 192.168.107.18>: HTTPConnectionPool(host='192.168.107.18', port=1400): Max retries exceeded with url: /xml/device_description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f14404f5c60>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
2023-01-08 23:37:00.212 WARNING (SyncWorker_6) [homeassistant.components.sonos] Failed to add SonosSpeaker using <SoCo object at ip 192.168.107.86>: HTTPConnectionPool(host='192.168.107.86', port=1400): Max retries exceeded with url: /xml/device_description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1440276ad0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))

👍

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Jan 8, 2023

Turning them back on and waiting to make sure they go available

Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Came back up 👍

@bdraco bdraco merged commit 9d7e99e into home-assistant:dev Jan 8, 2023
@jjlawren jjlawren deleted the sonos/timeouts-and-logging branch January 8, 2023 23:47
tronikos pushed a commit to tronikos/home-assistant-core that referenced this pull request Jan 9, 2023
shbatm pushed a commit to shbatm/home-assistant-core that referenced this pull request Jan 9, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants