Replies: 2 comments 1 reply
-
@niltrip Can you please provide an exact version number, so we all have the same state of code in mind? |
Beta Was this translation helpful? Give feedback.
1 reply
-
can't reproduce with version 1.1.0-pre1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@tolwi
Hello,
I'm trying to get the PowerOcean to work. With the current version I manage to create the device and initialize parameters. However, the update does not work. I think it's because of the structure of the return (nested). In the HA interface I only get a meaningless error message:
Bad logger message:
Error updating data ((KeyError('params'),)) (data_holder.py approx. line 102)
In the console of the HA devcontainer there is more.
`--- Logging error ---
Traceback (most recent call last):
File "/workspaces/core/config/custom_components/ecoflow_cloud/devices/data_holder.py", line 94, in update_data
self.params.update(raw["params"])
~~~^^^^^^^^^^
KeyError: 'params'
During handling of the above exception, another exception occurred:
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 "/usr/local/lib/python3.12/threading.py", line 1030, in _bootstrap
self._bootstrap_inner()
File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3591, in _thread_main
self.loop_forever(retry_first_connection=True)
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1756, in loop_forever
rc = self._loop(timeout)
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1164, in _loop
rc = self.loop_read()
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 1556, in loop_read
rc = self._packet_read()
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 2439, in _packet_read
rc = self._packet_handle()
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle
return self._handle_publish()
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish
self._handle_on_message(message)
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message
on_message(self, self._userdata, message)
File "/workspaces/core/config/custom_components/ecoflow_cloud/api/ecoflow_mqtt.py", line 91, in on_message
self.__device.update_data(message.payload, message.topic)
File "/workspaces/core/config/custom_components/ecoflow_cloud/devices/init.py", line 72, in update_data
self.data.update_data(raw)
File "/workspaces/core/config/custom_components/ecoflow_cloud/devices/data_holder.py", line 102, in update_data
_LOGGER.error("Error updating data", error)
File "/usr/local/lib/python3.12/logging/init.py", line 1568, in error
self._log(ERROR, 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 "/workspaces/core/homeassistant/util/logging.py", line 41, in handle
self.emit(record)
Message: 'Error updating data'
Arguments: (KeyError('params'),)
`
Am I in the right place?
I think the data from the answer needs to be processed more before you get a key: value? Where exactly in the code is this done?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions