Skip to content

Commit

Permalink
Use debug/warning instead of info log level in components [m] (#126074)
Browse files Browse the repository at this point in the history
* Use debug instead of info log level in components [m]

* Fix modbus test
  • Loading branch information
jpbede authored Sep 17, 2024
1 parent 219417c commit 2ec0d8e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/mediaroom/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, host, device_id, optimistic=False, timeout=DEFAULT_TIMEOUT):

self.host = host
self.stb = Remote(host)
_LOGGER.info(
_LOGGER.debug(
"Found STB at %s%s", host, " - I'm optimistic" if optimistic else ""
)
self._channel = None
Expand Down
6 changes: 3 additions & 3 deletions homeassistant/components/minio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def __init__(self, hass):

def run(self):
"""Listen to queue events, and forward them to Home Assistant event bus."""
_LOGGER.info("Running QueueListener")
_LOGGER.debug("Running QueueListener")
while True:
if (event := self._queue.get()) is None:
break
Expand All @@ -203,10 +203,10 @@ def queue(self):

def stop(self):
"""Stop run by putting None into queue and join the thread."""
_LOGGER.info("Stopping QueueListener")
_LOGGER.debug("Stopping QueueListener")
self._queue.put(None)
self.join()
_LOGGER.info("Stopped QueueListener")
_LOGGER.debug("Stopped QueueListener")

def start_handler(self, _):
"""Start handler helper method."""
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/minio/minio_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __exit__(self, exc_type, exc_val, exc_tb):

def run(self):
"""Create MinioClient and run the loop."""
_LOGGER.info("Running MinioEventThread")
_LOGGER.debug("Running MinioEventThread")

self._should_stop = False

Expand All @@ -125,7 +125,7 @@ def run(self):
)

while not self._should_stop:
_LOGGER.info("Connecting to minio event stream")
_LOGGER.debug("Connecting to minio event stream")
response = None
try:
response = get_minio_notification_response(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/modbus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ async def async_reset_platform(hass: HomeAssistant, integration_name: str) -> No
if DOMAIN not in hass.data:
_LOGGER.error("Modbus cannot reload, because it was never loaded")
return
_LOGGER.info("Modbus reloading")
_LOGGER.debug("Modbus reloading")
hubs = hass.data[DOMAIN]
for name in hubs:
await hubs[name].async_close()
2 changes: 1 addition & 1 deletion homeassistant/components/modbus/modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ async def async_pb_connect(self) -> None:
self._log_error(err, error_state=False)
return
message = f"modbus {self.name} communication open"
_LOGGER.info(message)
_LOGGER.warning(message)

This comment has been minimized.

Copy link
@codyc1515

codyc1515 Sep 30, 2024

Contributor

Why would we want to have a warning show on every boot?


async def async_setup(self) -> bool:
"""Set up pymodbus client."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/monoprice/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def async_setup_entry(
for i in range(1, 4):
for j in range(1, 7):
zone_id = (i * 10) + j
_LOGGER.info("Adding zone %d for port %s", zone_id, port)
_LOGGER.debug("Adding zone %d for port %s", zone_id, port)
entities.append(
MonopriceZone(monoprice, sources, config_entry.entry_id, zone_id)
)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mysensors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def setup_mysensors_platform(
devices[dev_id] = device_class_copy(*args_copy)
new_devices.append(devices[dev_id])
if new_devices:
_LOGGER.info("Adding new devices: %s", new_devices)
_LOGGER.debug("Adding new devices: %s", new_devices)
if async_add_entities is not None:
async_add_entities(new_devices)
return new_devices
4 changes: 2 additions & 2 deletions homeassistant/components/mysensors/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ def on_conn_made(_: BaseAsyncGateway) -> None:
await gateway_ready.wait()
return True
except TimeoutError:
_LOGGER.info("Try gateway connect failed with timeout")
_LOGGER.warning("Try gateway connect failed with timeout")
return False
finally:
if connect_task is not None and not connect_task.done():
connect_task.cancel()
await gateway.stop()
except OSError as err:
_LOGGER.info("Try gateway connect failed with exception", exc_info=err)
_LOGGER.warning("Try gateway connect failed with exception", exc_info=err)
return False


Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mystrom/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def _handle(self, hass, data):
button_id = data[button_action]
entity_id = f"{BINARY_SENSOR_DOMAIN}.{button_id}_{button_action}"
if entity_id not in self.buttons:
_LOGGER.info(
_LOGGER.debug(
"New myStrom button/action detected: %s/%s", button_id, button_action
)
self.buttons[entity_id] = MyStromBinarySensor(
Expand Down
6 changes: 3 additions & 3 deletions tests/components/modbus/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ async def test_stop_restart(
) -> None:
"""Run test for service stop."""

caplog.set_level(logging.INFO)
caplog.set_level(logging.WARNING)
entity_id = f"{SENSOR_DOMAIN}.{TEST_ENTITY_NAME}".replace(" ", "_")
assert hass.states.get(entity_id).state in (STATE_UNKNOWN, STATE_UNAVAILABLE)
hass.states.async_set(entity_id, 17)
Expand Down Expand Up @@ -1234,7 +1234,7 @@ async def test_integration_reload(
) -> None:
"""Run test for integration reload."""

caplog.set_level(logging.INFO)
caplog.set_level(logging.DEBUG)
caplog.clear()

yaml_path = get_fixture_path("configuration.yaml", "modbus")
Expand All @@ -1253,7 +1253,7 @@ async def test_integration_reload_failed(
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, mock_modbus
) -> None:
"""Run test for integration connect failure on reload."""
caplog.set_level(logging.INFO)
caplog.set_level(logging.DEBUG)
caplog.clear()

yaml_path = get_fixture_path("configuration.yaml", "modbus")
Expand Down

0 comments on commit 2ec0d8e

Please sign in to comment.