Skip to content

Commit

Permalink
Fix HTTP 500 when fetching subdevices
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
DRSchlaubi authored Jul 10, 2024
1 parent 66bd1af commit b930605
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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)

0 comments on commit b930605

Please sign in to comment.