MyHOME icon indicating copy to clipboard operation
MyHOME copied to clipboard

TypeError: not all arguments converted during string formatting

Open f18m opened this issue 1 year ago • 0 comments

I believe there's a but in file "/config/custom_components/myhome/gateway.py", line 380, in sending_loop on a LOGGER.debug() statement, see below logs I found on my logs:

2024-10-01 23:02:20.503 DEBUG (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Sending command session password.
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/logging/handlers.py", line 1493, in emit
    self.enqueue(self.prepare(record))
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/handlers.py", line 1475, in prepare
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/myhome/gateway.py", line 380, in sending_loop
    LOGGER.debug(
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1527, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1762, in callHandlers
    hdlr.handle(record)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 41, in handle
    self.emit(record)
Message: '%s Message `%s` was successfully unqueued by worker %s.'
Arguments: ('MyHomeServer1 Gateway', '192.168.1.6', *#2*02##, 0)
2024-10-01 23:02:20.615 DEBUG (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Message received: `*#2*02*10*10*0*001*0##`
2024-10-01 23:02:20.615 INFO (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Cover 02 is closed.
2024-10-01 23:02:20.641 DEBUG (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Message `*#2*02##` received response `*2*0*02##`.
2024-10-01 23:02:20.655 DEBUG (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Message received: `*2*0*02##`
2024-10-01 23:02:20.655 INFO (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Cover 02 stopped.
--- Logging error ---
2024-10-01 23:02:20.691 DEBUG (MainThread) [custom_components.myhome] [MyHomeServer1 gateway - 192.168.1.6] Message `*#2*02##` was successfully sent.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/logging/handlers.py", line 1493, in emit
    self.enqueue(self.prepare(record))
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/handlers.py", line 1475, in prepare
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/myhome/gateway.py", line 380, in sending_loop
    LOGGER.debug(
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1527, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1762, in callHandlers
    hdlr.handle(record)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 41, in handle
    self.emit(record)
Message: '%s Message `%s` was successfully unqueued by worker %s.'
Arguments: ('MyHomeServer1 Gateway', '192.168.1.6', *#2*03##, 0)

f18m avatar Oct 01 '24 21:10 f18m