How to use the kervi.actions.action function in kervi

To help you get started, we’ve selected a few kervi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kervi / kervi / kervi / build / lib / kervi / application / __init__.py View on Github external
    @action
    def reboot(self):
        print("reboot app device")
        self._app._reboot_action()
github kervi / kervi / kervi / build / lib / kervi / application / __init__.py View on Github external
    @action
    def restart(self):
        print("restart app")
        self._app._restart_action()
github kervi / kervi / kervi / controllers / steering.py View on Github external
    @action
    def stop(self, **kwargs):
        coast = kwargs.pop("break", True)
        self.outputs["left_speed"].value = 0
        self.outputs["right_speed"].value = 0
github kervi / kervi / kervi / kervi / module / __init__.py View on Github external
    @action
    def restart(self):
        self._module._restart_action()
github kervi / kervi / kervi / kervi / module / __init__.py View on Github external
    @action
    def stop(self):
        self._module._stop_action()
github kervi / kervi / kervi-core / kervi / controllers / steering.py View on Github external
    @action
    def stop(self, **kwargs):
        coast = kwargs.pop("break", True)
        self.outputs["left_speed"].value = 0
        self.outputs["right_speed"].value = 0
github kervi / kervi / kervi / build / lib / kervi / application / __init__.py View on Github external
    @action
    def stop(self):
        print("stop app")
        self._app._stop_action()
github kervi / kervi / kervi / controllers / steering.py View on Github external
    @action
    def rotate(self, **kwargs):
        speed = kwargs.pop("speed",None)
        wheel_rotations = kwargs.pop("wheel_rotations",None)
        duration = kwargs.pop("duration",None)
        
        print("steering rotate:", speed)
        new_direction = self._adjust
        left_speed = speed * (-new_direction / 100)
        right_speed = speed * (new_direction / 100)

        self.outputs["left_speed"].value = left_speed
        self.outputs["right_speed"].value = right_speed
        if duration:
            time.sleep(duration)
github kervi / kervi / kervi / kervi / application / __init__.py View on Github external
    @action(confirm=True, confirm_message="Reboot device")
    def reboot(self):
        self._app._reboot_action()