From b930605f486a1b58745f992524794395a4e4839d Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Wed, 10 Jul 2024 23:33:25 +0000 Subject: [PATCH] Fix HTTP 500 when fetching subdevices Signed-off-by: GitHub --- .../rootfs/opt/custom_broker/blueprints/hub.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meross_local_broker/rootfs/opt/custom_broker/blueprints/hub.py b/meross_local_broker/rootfs/opt/custom_broker/blueprints/hub.py index 5e12872..c5ba976 100644 --- a/meross_local_broker/rootfs/opt/custom_broker/blueprints/hub.py +++ b/meross_local_broker/rootfs/opt/custom_broker/blueprints/hub.py @@ -8,6 +8,7 @@ from decorator import meross_http_api from logger import get_logger from messaging import make_api_response +from model.db_models import SubDevice hub_blueprint = Blueprint('hub', __name__) _LOGGER = get_logger(__name__) @@ -32,4 +33,5 @@ def get_subdevices(api_payload: Dict, *args, **kwargs): _LOGGER.error("Invalid UUID or device not enrolled") raise HttpApiError(error_code=ErrorCodes.CODE_GENERIC_ERROR) - return make_api_response(data=device.child_subdevices) + data = SubDevice.serialize_list(device.child_subdevices) + return make_api_response(data=data)