From f1c21af65416a2cdce3243d9801df21fef8e9286 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 27 Nov 2024 18:29:36 +0100 Subject: [PATCH] add_services --- dpp/api_dlt.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dpp/api_dlt.py b/dpp/api_dlt.py index 38434b3..e815419 100644 --- a/dpp/api_dlt.py +++ b/dpp/api_dlt.py @@ -118,20 +118,20 @@ def register_device_dlt(chid, phid, ev_uuid, user): # TODO is neccesary? - # if settings.get('ID_FEDERATED'): - # cny = 1 - # while cny: - # try: - # api.add_service( - # chid, - # 'DeviceHub', - # settings.get('ID_FEDERATED'), - # 'Inventory service', - # 'Inv', - # ) - # cny = 0 - # except Exception: - # time.sleep(10) + if settings.get('ID_FEDERATED'): + cny = 1 + while cny: + try: + api.add_service( + chid, + 'DeviceHub', + settings.get('ID_FEDERATED'), + 'Inventory service', + 'Inv', + ) + cny = 0 + except Exception: + time.sleep(10) def register_passport_dlt(chid, phid, ev_uuid, user):