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:
parent
219417cfb5
commit
2ec0d8e8ef
10 changed files with 16 additions and 16 deletions
|
@ -149,7 +149,7 @@ class MediaroomDevice(MediaPlayerEntity):
|
||||||
|
|
||||||
self.host = host
|
self.host = host
|
||||||
self.stb = Remote(host)
|
self.stb = Remote(host)
|
||||||
_LOGGER.info(
|
_LOGGER.debug(
|
||||||
"Found STB at %s%s", host, " - I'm optimistic" if optimistic else ""
|
"Found STB at %s%s", host, " - I'm optimistic" if optimistic else ""
|
||||||
)
|
)
|
||||||
self._channel = None
|
self._channel = None
|
||||||
|
|
|
@ -181,7 +181,7 @@ class QueueListener(threading.Thread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Listen to queue events, and forward them to Home Assistant event bus."""
|
"""Listen to queue events, and forward them to Home Assistant event bus."""
|
||||||
_LOGGER.info("Running QueueListener")
|
_LOGGER.debug("Running QueueListener")
|
||||||
while True:
|
while True:
|
||||||
if (event := self._queue.get()) is None:
|
if (event := self._queue.get()) is None:
|
||||||
break
|
break
|
||||||
|
@ -203,10 +203,10 @@ class QueueListener(threading.Thread):
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stop run by putting None into queue and join the thread."""
|
"""Stop run by putting None into queue and join the thread."""
|
||||||
_LOGGER.info("Stopping QueueListener")
|
_LOGGER.debug("Stopping QueueListener")
|
||||||
self._queue.put(None)
|
self._queue.put(None)
|
||||||
self.join()
|
self.join()
|
||||||
_LOGGER.info("Stopped QueueListener")
|
_LOGGER.debug("Stopped QueueListener")
|
||||||
|
|
||||||
def start_handler(self, _):
|
def start_handler(self, _):
|
||||||
"""Start handler helper method."""
|
"""Start handler helper method."""
|
||||||
|
|
|
@ -116,7 +116,7 @@ class MinioEventThread(threading.Thread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Create MinioClient and run the loop."""
|
"""Create MinioClient and run the loop."""
|
||||||
_LOGGER.info("Running MinioEventThread")
|
_LOGGER.debug("Running MinioEventThread")
|
||||||
|
|
||||||
self._should_stop = False
|
self._should_stop = False
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ class MinioEventThread(threading.Thread):
|
||||||
)
|
)
|
||||||
|
|
||||||
while not self._should_stop:
|
while not self._should_stop:
|
||||||
_LOGGER.info("Connecting to minio event stream")
|
_LOGGER.debug("Connecting to minio event stream")
|
||||||
response = None
|
response = None
|
||||||
try:
|
try:
|
||||||
response = get_minio_notification_response(
|
response = get_minio_notification_response(
|
||||||
|
|
|
@ -464,7 +464,7 @@ async def async_reset_platform(hass: HomeAssistant, integration_name: str) -> No
|
||||||
if DOMAIN not in hass.data:
|
if DOMAIN not in hass.data:
|
||||||
_LOGGER.error("Modbus cannot reload, because it was never loaded")
|
_LOGGER.error("Modbus cannot reload, because it was never loaded")
|
||||||
return
|
return
|
||||||
_LOGGER.info("Modbus reloading")
|
_LOGGER.debug("Modbus reloading")
|
||||||
hubs = hass.data[DOMAIN]
|
hubs = hass.data[DOMAIN]
|
||||||
for name in hubs:
|
for name in hubs:
|
||||||
await hubs[name].async_close()
|
await hubs[name].async_close()
|
||||||
|
|
|
@ -341,7 +341,7 @@ class ModbusHub:
|
||||||
self._log_error(err, error_state=False)
|
self._log_error(err, error_state=False)
|
||||||
return
|
return
|
||||||
message = f"modbus {self.name} communication open"
|
message = f"modbus {self.name} communication open"
|
||||||
_LOGGER.info(message)
|
_LOGGER.warning(message)
|
||||||
|
|
||||||
async def async_setup(self) -> bool:
|
async def async_setup(self) -> bool:
|
||||||
"""Set up pymodbus client."""
|
"""Set up pymodbus client."""
|
||||||
|
|
|
@ -71,7 +71,7 @@ async def async_setup_entry(
|
||||||
for i in range(1, 4):
|
for i in range(1, 4):
|
||||||
for j in range(1, 7):
|
for j in range(1, 7):
|
||||||
zone_id = (i * 10) + j
|
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(
|
entities.append(
|
||||||
MonopriceZone(monoprice, sources, config_entry.entry_id, zone_id)
|
MonopriceZone(monoprice, sources, config_entry.entry_id, zone_id)
|
||||||
)
|
)
|
||||||
|
|
|
@ -148,7 +148,7 @@ def setup_mysensors_platform(
|
||||||
devices[dev_id] = device_class_copy(*args_copy)
|
devices[dev_id] = device_class_copy(*args_copy)
|
||||||
new_devices.append(devices[dev_id])
|
new_devices.append(devices[dev_id])
|
||||||
if new_devices:
|
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:
|
if async_add_entities is not None:
|
||||||
async_add_entities(new_devices)
|
async_add_entities(new_devices)
|
||||||
return new_devices
|
return new_devices
|
||||||
|
|
|
@ -114,14 +114,14 @@ async def try_connect(
|
||||||
await gateway_ready.wait()
|
await gateway_ready.wait()
|
||||||
return True
|
return True
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
_LOGGER.info("Try gateway connect failed with timeout")
|
_LOGGER.warning("Try gateway connect failed with timeout")
|
||||||
return False
|
return False
|
||||||
finally:
|
finally:
|
||||||
if connect_task is not None and not connect_task.done():
|
if connect_task is not None and not connect_task.done():
|
||||||
connect_task.cancel()
|
connect_task.cancel()
|
||||||
await gateway.stop()
|
await gateway.stop()
|
||||||
except OSError as err:
|
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
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class MyStromView(HomeAssistantView):
|
||||||
button_id = data[button_action]
|
button_id = data[button_action]
|
||||||
entity_id = f"{BINARY_SENSOR_DOMAIN}.{button_id}_{button_action}"
|
entity_id = f"{BINARY_SENSOR_DOMAIN}.{button_id}_{button_action}"
|
||||||
if entity_id not in self.buttons:
|
if entity_id not in self.buttons:
|
||||||
_LOGGER.info(
|
_LOGGER.debug(
|
||||||
"New myStrom button/action detected: %s/%s", button_id, button_action
|
"New myStrom button/action detected: %s/%s", button_id, button_action
|
||||||
)
|
)
|
||||||
self.buttons[entity_id] = MyStromBinarySensor(
|
self.buttons[entity_id] = MyStromBinarySensor(
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ async def test_stop_restart(
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run test for service stop."""
|
"""Run test for service stop."""
|
||||||
|
|
||||||
caplog.set_level(logging.INFO)
|
caplog.set_level(logging.WARNING)
|
||||||
entity_id = f"{SENSOR_DOMAIN}.{TEST_ENTITY_NAME}".replace(" ", "_")
|
entity_id = f"{SENSOR_DOMAIN}.{TEST_ENTITY_NAME}".replace(" ", "_")
|
||||||
assert hass.states.get(entity_id).state in (STATE_UNKNOWN, STATE_UNAVAILABLE)
|
assert hass.states.get(entity_id).state in (STATE_UNKNOWN, STATE_UNAVAILABLE)
|
||||||
hass.states.async_set(entity_id, 17)
|
hass.states.async_set(entity_id, 17)
|
||||||
|
@ -1234,7 +1234,7 @@ async def test_integration_reload(
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run test for integration reload."""
|
"""Run test for integration reload."""
|
||||||
|
|
||||||
caplog.set_level(logging.INFO)
|
caplog.set_level(logging.DEBUG)
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
yaml_path = get_fixture_path("configuration.yaml", "modbus")
|
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
|
hass: HomeAssistant, caplog: pytest.LogCaptureFixture, mock_modbus
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Run test for integration connect failure on reload."""
|
"""Run test for integration connect failure on reload."""
|
||||||
caplog.set_level(logging.INFO)
|
caplog.set_level(logging.DEBUG)
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
yaml_path = get_fixture_path("configuration.yaml", "modbus")
|
yaml_path = get_fixture_path("configuration.yaml", "modbus")
|
||||||
|
|
Loading…
Add table
Reference in a new issue