Feature/interface descriptions (#348)

This commit is contained in:
cybermaggedon 2025-04-25 15:59:34 +01:00 committed by GitHub
parent 76e85d895b
commit 342f555948
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 76 additions and 16 deletions

View file

@ -112,9 +112,27 @@ class FlowConfig:
self.config["flows-active"][processor] = json.dumps(target)
def repl_interface(i):
if isinstance(i, str):
return repl_template(i)
else:
return {
k: repl_template(v)
for k, v in i.items()
}
if "interfaces" in cls:
interfaces = {
k: repl_interface(v)
for k, v in cls["interfaces"].items()
}
else:
interfaces = {}
self.config["flows"][msg.flow_id] = json.dumps({
"description": msg.description,
"class-name": msg.class_name,
"interfaces": interfaces,
})
await self.config.push()