diff sat_frontends/jp/base.py @ 4041:2594e1951cf7

core (bridge): `action_new` now use serialised dict for extra data.
author Goffi <goffi@goffi.org>
date Mon, 15 May 2023 16:20:45 +0200
parents 524856bd7b19
children 877145b4ba01
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Mon May 15 16:20:38 2023 +0200
+++ b/sat_frontends/jp/base.py	Mon May 15 16:20:45 2023 +0200
@@ -1387,9 +1387,16 @@
     def __init__(self, *args, **kwargs):
         super(CommandAnswering, self).__init__(*args, **kwargs)
 
-    async def on_action_new(self, action_data, action_id, security_limit, profile):
+    async def on_action_new(
+        self,
+        action_data_s: str,
+        action_id: str,
+        security_limit: int,
+        profile: str
+    ) -> None:
         if profile != self.profile:
             return
+        action_data = data_format.deserialise(action_data_s)
         try:
             action_type = action_data['meta_type']
         except KeyError:
@@ -1424,5 +1431,5 @@
         """Auto reply to confirmation requests"""
         self.host.bridge.register_signal("action_new", self.on_action_new)
         actions = await self.host.bridge.actions_get(self.profile)
-        for action_data, action_id, security_limit in actions:
-            await self.on_action_new(action_data, action_id, security_limit, self.profile)
+        for action_data_s, action_id, security_limit in actions:
+            await self.on_action_new(action_data_s, action_id, security_limit, self.profile)