mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Fix for Sonos debug logging (#25064)
* Fix for Sonos debug logging * Start logging messages with capital letters
This commit is contained in:
parent
7d33b0a259
commit
1afa136fc0
@ -77,7 +77,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
hass.data[DATA_SONOS] = SonosData(hass)
|
hass.data[DATA_SONOS] = SonosData(hass)
|
||||||
|
|
||||||
config = hass.data[SONOS_DOMAIN].get('media_player', {})
|
config = hass.data[SONOS_DOMAIN].get('media_player', {})
|
||||||
_LOGGER.debug("async_setup_entry, config=%s", config)
|
_LOGGER.debug("Reached async_setup_entry, config=%s", config)
|
||||||
|
|
||||||
advertise_addr = config.get(CONF_ADVERTISE_ADDR)
|
advertise_addr = config.get(CONF_ADVERTISE_ADDR)
|
||||||
if advertise_addr:
|
if advertise_addr:
|
||||||
@ -90,22 +90,22 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
def _discovered_player(soco):
|
def _discovered_player(soco):
|
||||||
"""Handle a (re)discovered player."""
|
"""Handle a (re)discovered player."""
|
||||||
try:
|
try:
|
||||||
_LOGGER.debug("_discovered_player, soco=%s", soco)
|
_LOGGER.debug("Reached _discovered_player, soco=%s", soco)
|
||||||
entity = _get_entity_from_soco_uid(hass, soco.uid)
|
entity = _get_entity_from_soco_uid(hass, soco.uid)
|
||||||
|
|
||||||
if not entity:
|
if not entity:
|
||||||
_LOGGER.debug("adding new entity")
|
_LOGGER.debug("Adding new entity")
|
||||||
hass.add_job(async_add_entities, [SonosEntity(soco)])
|
hass.add_job(async_add_entities, [SonosEntity(soco)])
|
||||||
else:
|
else:
|
||||||
_LOGGER.debug("seen %s", entity)
|
_LOGGER.debug("Seen %s", entity)
|
||||||
hass.add_job(entity.async_seen())
|
hass.add_job(entity.async_seen())
|
||||||
except SoCoException as ex:
|
except SoCoException as ex:
|
||||||
_LOGGER.debug("SoCoException, ex=%s")
|
_LOGGER.debug("SoCoException, ex=%s", ex)
|
||||||
|
|
||||||
if hosts:
|
if hosts:
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
try:
|
try:
|
||||||
_LOGGER.debug("testing %s", host)
|
_LOGGER.debug("Testing %s", host)
|
||||||
player = pysonos.SoCo(socket.gethostbyname(host))
|
player = pysonos.SoCo(socket.gethostbyname(host))
|
||||||
if player.is_visible:
|
if player.is_visible:
|
||||||
# Make sure that the player is available
|
# Make sure that the player is available
|
||||||
@ -113,20 +113,20 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
|
|
||||||
_discovered_player(player)
|
_discovered_player(player)
|
||||||
except (OSError, SoCoException) as ex:
|
except (OSError, SoCoException) as ex:
|
||||||
_LOGGER.debug("exception %s", ex)
|
_LOGGER.debug("Exception %s", ex)
|
||||||
if now is None:
|
if now is None:
|
||||||
_LOGGER.warning("Failed to initialize '%s'", host)
|
_LOGGER.warning("Failed to initialize '%s'", host)
|
||||||
|
|
||||||
_LOGGER.debug("tested all hosts")
|
_LOGGER.debug("Tested all hosts")
|
||||||
hass.helpers.event.call_later(DISCOVERY_INTERVAL, _discovery)
|
hass.helpers.event.call_later(DISCOVERY_INTERVAL, _discovery)
|
||||||
else:
|
else:
|
||||||
_LOGGER.debug("starting discovery thread")
|
_LOGGER.debug("Starting discovery thread")
|
||||||
pysonos.discover_thread(
|
pysonos.discover_thread(
|
||||||
_discovered_player,
|
_discovered_player,
|
||||||
interval=DISCOVERY_INTERVAL,
|
interval=DISCOVERY_INTERVAL,
|
||||||
interface_addr=config.get(CONF_INTERFACE_ADDR))
|
interface_addr=config.get(CONF_INTERFACE_ADDR))
|
||||||
|
|
||||||
_LOGGER.debug("adding discovery job")
|
_LOGGER.debug("Adding discovery job")
|
||||||
hass.async_add_executor_job(_discovery)
|
hass.async_add_executor_job(_discovery)
|
||||||
|
|
||||||
async def async_service_handle(service, data):
|
async def async_service_handle(service, data):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user