diff --git a/ml/thing.py b/ml/thing.py index 6afc4f386a62992d3a296eb5a6ba8988ec9ce57e..4e181f382c8d40b4913315c16a2de45d3899340e 100644 --- a/ml/thing.py +++ b/ml/thing.py @@ -132,7 +132,7 @@ def _add_on_channel_open_callback(_thing, _callback, _one_shot, *_args, **_kwarg ) def add_ml40_implementation(self, implementation_object, ml40_feature, *args, **kwargs): - def _add_ml40_implementation(_thing, _implementation_object, _ml40_feature, *_args, **_kwargs): + async def _add_ml40_implementation(_thing, _implementation_object, _ml40_feature, *_args, **_kwargs): feature = _thing.entry.features.get(_ml40_feature, None) if feature is None: APP_LOGGER.critical( @@ -212,8 +212,9 @@ def __get_remaining_time_to_refresh(self): def __setup_thing_json_sync(self): APP_LOGGER.info("[S3I]: Start the thing") self.__recursively_update_dt_json(frequency=self.parameters.thing_sync_freq) - self.callbacks.process( - prefix=self._ON_THING_START_OK + self.callbacks.process_async_task( + prefix=self._ON_THING_START_OK, + loop=self.loop ) def __setup_directory(self):