albertogeniola / ha-meross-local-broker

HomeAssistant addon that handles LAN-local MQTT and API service for Meross Devices.
Apache License 2.0
33 stars 14 forks source link

HTTP 500 when fetching subdevices #49

Open DRSchlaubi opened 4 months ago

DRSchlaubi commented 4 months ago
2024-07-10 23:09:13.776606598 TypeError: Object of type SubDevice is not JSON serializable
2024-07-10 23:09:13.776605901 raise TypeError(f'Object of type {o.__class__.__name__} '
2024-07-10 23:09:13.776605198 File "/usr/lib/python3.7/json/encoder.py", line 179, in default
2024-07-10 23:09:13.776604469 return super().default(o)
2024-07-10 23:09:13.776603850 File "/usr/local/lib/python3.7/dist-packages/flask/json/__init__.py", line 50, in default
2024-07-10 23:09:13.776603086 return _iterencode(o, 0)
2024-07-10 23:09:13.776602474 File "/usr/lib/python3.7/json/encoder.py", line 257, in iterencode
2024-07-10 23:09:13.776601741 chunks = self.iterencode(o, _one_shot=True)
2024-07-10 23:09:13.776601076 File "/usr/lib/python3.7/json/encoder.py", line 199, in encode
2024-07-10 23:09:13.776600418 **kw).encode(obj)
2024-07-10 23:09:13.776599844 File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
2024-07-10 23:09:13.776599113 return _json.dumps(obj, **kwargs)
2024-07-10 23:09:13.776598484 File "/usr/local/lib/python3.7/dist-packages/flask/json/__init__.py", line 131, in dumps
2024-07-10 23:09:13.776597689 f"{dumps(data, indent=indent, separators=separators)}\n",
2024-07-10 23:09:13.776596998 File "/usr/local/lib/python3.7/dist-packages/flask/json/__init__.py", line 297, in jsonify
2024-07-10 23:09:13.776596226 "data": data
2024-07-10 23:09:13.776595668 File "/opt/custom_broker/messaging.py", line 14, in make_api_response
2024-07-10 23:09:13.776594930 return make_api_response(data=device.child_subdevices)
2024-07-10 23:09:13.776594211 File "/opt/custom_broker/blueprints/hub.py", line 35, in get_subdevices
2024-07-10 23:09:13.776593448 return f(*args, **kwargs, api_payload=payload)
2024-07-10 23:09:13.776592805 File "/opt/custom_broker/decorator.py", line 83, in wrap
2024-07-10 23:09:13.776592084 return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
2024-07-10 23:09:13.776591279 File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1509, in dispatch_request
2024-07-10 23:09:13.776590431 rv = self.dispatch_request()
2024-07-10 23:09:13.776589645 File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1523, in full_dispatch_request
2024-07-10 23:09:13.776588742 Traceback (most recent call last):