Esempio n. 1
0
    def clear_hw_rule(self, switch: Switch):
        """Clear all rules for switch and this driver.

        Args:
            switch: Switch to clear on this driver.
        """
        self.platform.clear_hw_rule(switch.get_configured_switch(), self.get_configured_driver())
Esempio n. 2
0
    def set_pulse_on_hit_and_enable_and_release_and_disable_rule(self, enable_switch: Switch, disable_switch: Switch):
        """Add pulse on hit and enable and release and disable rule to driver.

        Pulse and then enable driver. Cancel pulse and enable when switch is released or a disable switch is hit.

        Args:
            enable_switch: Switch which triggers the rule.
            disable_switch: Switch which disables the rule.
        """
        self._check_platform(enable_switch)
        self._check_platform(disable_switch)

        self.platform.set_pulse_on_hit_and_enable_and_release_and_disable_rule(
            enable_switch.get_configured_switch(),
            disable_switch.get_configured_switch(),
            self.get_configured_driver()
        )
Esempio n. 3
0
    def set_pulse_on_hit_rule(self, enable_switch: Switch):
        """Add pulse on hit rule to driver.

        Alway do the full pulse. Even when the switch is released.

        Args:
            enable_switch: Switch which triggers the rule.
        """
        self._check_platform(enable_switch)

        self.platform.set_pulse_on_hit_rule(enable_switch.get_configured_switch(), self.get_configured_driver())
Esempio n. 4
0
    def set_pulse_on_hit_and_enable_and_release_rule(self, enable_switch: Switch):
        """Add pulse on hit and enable and relase rule to driver.

        Pulse and enable a driver. Cancel pulse and enable if switch is released.

        Args:
            enable_switch: Switch which triggers the rule.
        """
        self._check_platform(enable_switch)

        self.platform.set_pulse_on_hit_and_enable_and_release_rule(enable_switch.get_configured_switch(),
                                                                   self.get_configured_driver())