-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'dict' object has no attribute 'device_type' in thinq2\model\thinq.py in method plymorphism #19
Comments
After inserting the condition above and logging the item I got this result: C:\Users\eduar\PycharmProjects\thinq2-python\venv\Scripts\python.exe C:\Users\eduar\PycharmProjects\thinq2-python\KlimaG.py Devices: 2023-01-05 10:57:32 | urllib3.connectionpool | DEBUG | Starting new HTTPS connection (1): eic-service.lgthinq.com:46030 Listening for device events. Use Ctrl-C/SIGINT to quit. And the programm ran and printed out the payload of the incomming MQTT messages. :-) |
I did this modification but I still get the same error |
I had this error before I changed the follwing in file thinq2\model\thinq.py:
@post_load(pass_original=True)
def polymorphism(self, item, data, **kwargs):
C:\Users\eduar\PycharmProjects\thinq2-python\venv\Scripts\python.exe C:\Users\eduar\PycharmProjects\thinq2-python\KlimaG.py
UserID: [email protected]
User #: DE2210150767551
Devices:
Traceback (most recent call last):
File "C:\Users\eduar\PycharmProjects\thinq2-python\KlimaG.py", line 108, in
KlimaG.main()
File "C:\Users\eduar\PycharmProjects\thinq2-python\Core.py", line 111, in main
devices = thinq.mqtt.thinq_client.get_devices()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\builder.py", line 106, in call
return execution.start(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 97, in start
return self._io.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 122, in execute
return self._io.execute(executable)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 122, in execute
return self._io.execute(executable)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 122, in execute
return self._io.execute(executable)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 31, in execute
return executable.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 36, in execute
return execution.before_request(self._request)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 56, in before_request
return self.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 105, in execute
return execution.send(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 73, in send
return self._io.invoke(self._client.send, (request,), {}, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 21, in invoke
return callback.on_success(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 96, in on_success
return self._context.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 123, in execute
return execution.after_response(self._request, self._response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 62, in after_response
return self.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 65, in execute
return execution.sleep(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 76, in sleep
return self._io.sleep(duration, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 119, in sleep
return self._io.sleep(duration, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 119, in sleep
return self._io.sleep(duration, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 119, in sleep
return self._io.sleep(duration, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 25, in sleep
return callback.on_success()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 52, in on_success
return self._context.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 36, in execute
return execution.before_request(self._request)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 56, in before_request
return self.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 105, in execute
return execution.send(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 73, in send
return self._io.invoke(self._client.send, (request,), {}, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 116, in invoke
return self._io.invoke(func, args, kwargs, callback)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 21, in invoke
return callback.on_success(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 96, in on_success
return self._context.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 123, in execute
return execution.after_response(self._request, self._response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 62, in after_response
return self.execute()
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 93, in execute
return self.state.execute(self)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\state.py", line 221, in execute
return execution.finish(self._response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 79, in finish
return self._io.finish(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 125, in finish
return self._io.finish(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 125, in finish
return self._io.finish(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 143, in finish
return self._invoke(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 133, in _invoke
return self._io.invoke(func, args, kwargs, FinishingCallback(self._io))
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 19, in invoke
return callback.on_failure(type(error), error, tb)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\execution.py", line 108, in on_failure
return self.io.fail(exc_type, exc_val, exc_tb)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\interfaces.py", line 300, in fail
compat.reraise(exc_type, exc_val, exc_tb)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\six.py", line 719, in reraise
raise value
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\io\blocking_strategy.py", line 16, in invoke
response = func(*arg, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\clients\requests.py", line 53, in apply_callback
return callback(response)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\builder.py", line 47, in wrapper
return func(self._consumer, *args, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\hooks.py", line 21, in wrapper
return hook(*args, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\returns.py", line 39, in call
return self.strategy(*args, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\converters\interfaces.py", line 6, in call
return self.convert(*args, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\uplink\converters\marshmallow.py", line 59, in convert
return self._extract_data(self._schema.load(json))
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 722, in load
return self._do_load(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 861, in _do_load
result = self._deserialize(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 664, in _deserialize
value = self._call_and_store(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 500, in _call_and_store
value = getter_func(data)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 661, in
getter = lambda val: field_obj.deserialize(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 370, in deserialize
output = self._deserialize(value, attr, data, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 673, in _deserialize
return self._load(value, data, partial=partial)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 656, in load
valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow_dataclass_init.py", line 752, in load
all_loaded = super().load(data, many=many, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 722, in load
return self._do_load(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 861, in _do_load
result = self._deserialize(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 664, in _deserialize
value = self._call_and_store(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 500, in _call_and_store
value = getter_func(data)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 661, in
getter = lambda val: field_obj.deserialize(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 370, in deserialize
output = self._deserialize(value, attr, data, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 788, in _deserialize
result.append(self.inner.deserialize(each, **kwargs))
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 370, in deserialize
output = self._deserialize(value, attr, data, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 673, in _deserialize
return self._load(value, data, partial=partial)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\fields.py", line 656, in load
valid_data = self.schema.load(value, unknown=self.unknown, partial=partial)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow_dataclass_init.py", line 752, in load
all_loaded = super().load(data, many=many, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 722, in load
return self._do_load(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 897, in _do_load
result = self._invoke_load_processors(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 1095, in _invoke_load_processors
data = self._invoke_processors(
File "C:\Users\eduar\PycharmProjects\thinq2-python\venv\lib\site-packages\marshmallow\schema.py", line 1223, in _invoke_processors
data = processor(data, original_data, many=many, **kwargs)
File "C:\Users\eduar\PycharmProjects\thinq2-python\thinq2\model\thinq.py", line 78, in polymorphism
device_schema = device_types.get(item.device_type, Device).Schema()
AttributeError: 'dict' object has no attribute 'device_type'
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: