Skip to content

Commit

Permalink
fix(bridge/python): widget default wrapper_props
Browse files Browse the repository at this point in the history
  • Loading branch information
louistiti committed Nov 20, 2024
1 parent ea8ba0f commit bde8663
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bridges/python/src/sdk/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Widget(ABC, Generic[T]):
def __init__(self, options: WidgetOptions[T]):
if options.wrapper_props:
self.wrapper_props = options.wrapper_props
else:
self.wrapper_props = None
self.action_name = f"{INTENT_OBJECT['domain']}:{INTENT_OBJECT['skill']}:{INTENT_OBJECT['action']}"
self.params = options.params
self.widget = self.__class__.__name__
Expand All @@ -54,6 +56,8 @@ def __init__(self, options: WidgetOptions[T]):
'widgetId': options.on_fetch.get('widget_id'),
'actionName': f"{INTENT_OBJECT['domain']}:{INTENT_OBJECT['skill']}:{options.on_fetch.get('action_name')}"
}
else:
self.on_fetch = None
self.id = options.on_fetch.get('widget_id') if options.on_fetch \
else f"{self.widget.lower()}-{''.join(random.choices(string.ascii_lowercase + string.digits, k=8))}"

Expand Down

0 comments on commit bde8663

Please sign in to comment.