Use debug/warning instead of info log level in components [m] (#126074)

* Use debug instead of info log level in components [m]

* Fix modbus test
This commit is contained in:
Jan-Philipp Benecke 2024-09-17 16:14:59 +02:00 committed by GitHub
parent 219417cfb5
commit 2ec0d8e8ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 16 deletions

View file

@ -149,7 +149,7 @@ class MediaroomDevice(MediaPlayerEntity):
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

View file

@ -181,7 +181,7 @@ class QueueListener(threading.Thread):
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
@ -203,10 +203,10 @@ class QueueListener(threading.Thread):
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."""

View file

@ -116,7 +116,7 @@ class MinioEventThread(threading.Thread):
def run(self):
"""Create MinioClient and run the loop."""
_LOGGER.info("Running MinioEventThread")
_LOGGER.debug("Running MinioEventThread")
self._should_stop = False
@ -125,7 +125,7 @@ class MinioEventThread(threading.Thread):
)
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(

View file

@ -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()

View file

@ -341,7 +341,7 @@ class ModbusHub:
self._log_error(err, error_state=False)
return
message = f"modbus {self.name} communication open"
_LOGGER.info(message)
_LOGGER.warning(message)
async def async_setup(self) -> bool:
"""Set up pymodbus client."""

View file

@ -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)
)

View file

@ -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

View file

@ -114,14 +114,14 @@ async def try_connect(
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

View file

@ -60,7 +60,7 @@ class MyStromView(HomeAssistantView):
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(

View file

@ -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)
@ -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")
@ -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")