Include advertise_addr in Sonos logs when used (#53617)
This commit is contained in:
parent
1b96288799
commit
9111fb60d7
1 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import soco.config as soco_config
|
||||||
from soco.core import SoCo
|
from soco.core import SoCo
|
||||||
from soco.exceptions import SoCoException
|
from soco.exceptions import SoCoException
|
||||||
|
|
||||||
|
@ -65,10 +66,14 @@ class SonosEntity(Entity):
|
||||||
async def async_poll(self, now: datetime.datetime) -> None:
|
async def async_poll(self, now: datetime.datetime) -> None:
|
||||||
"""Poll the entity if subscriptions fail."""
|
"""Poll the entity if subscriptions fail."""
|
||||||
if not self.speaker.subscriptions_failed:
|
if not self.speaker.subscriptions_failed:
|
||||||
|
if soco_config.EVENT_ADVERTISE_IP:
|
||||||
|
listener_msg = f"{self.speaker.subscription_address} (advertising as {soco_config.EVENT_ADVERTISE_IP})"
|
||||||
|
else:
|
||||||
|
listener_msg = self.speaker.subscription_address
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"%s cannot reach [%s], falling back to polling, functionality may be limited",
|
"%s cannot reach %s, falling back to polling, functionality may be limited",
|
||||||
self.speaker.zone_name,
|
self.speaker.zone_name,
|
||||||
self.speaker.subscription_address,
|
listener_msg,
|
||||||
)
|
)
|
||||||
self.speaker.subscriptions_failed = True
|
self.speaker.subscriptions_failed = True
|
||||||
await self.speaker.async_unsubscribe()
|
await self.speaker.async_unsubscribe()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue