Skip to content

2.2.0

Compare
Choose a tag to compare
@david-lev david-lev released this 28 Nov 22:06
· 37 commits to master since this release

What's Changed

Update with pip: pip3 install -U pywa

  • [flows] adding ScreenDataUpdate to use in UpdateDataAction
  • [flows] using math operators between math objs
  • [flows] renaming ActionNext to Next and ActionNextType to NextType
from pywa.types.flows import *

FlowJSON(
    version="6.0",
    screens=[
        Screen(
            id="DEMO_SCREEN",
            data=[
                is_txt_visible := ScreenData(  # Declaring a data object
                    key="is_txt_visible",
                    example=False,
                ),
            ],
            layout=Layout(
                children=[
                    TextBody(
                        text="You checked the box!",
                        visible=is_txt_visible.ref,  # Using the data
                    ),
                    OptIn(
                        label="Show the text",
                        name="show_txt",
                        on_select_action=UpdateDataAction(
                            payload=[is_txt_visible.update(True)]  # Updating the data
                        ),
                        on_unselect_action=UpdateDataAction(
                            payload=[is_txt_visible.update(False)]
                        ),
                    ),
                ]
            ),
        )
    ],
)

Full Changelog: 2.1.0...2.2.0