duck.automation.trigger

Module for Automation Triggers.

This module provides classes for defining and managing automation triggers. It includes a base AutomationTrigger class and a NoTrigger class for scenarios where no trigger is needed.

Module Contents

Classes

AutomationTrigger

Base class for Automation Triggers.

NoTriggerBase

A trigger that always returns True.

Data

NoTrigger

API

class duck.automation.trigger.AutomationTrigger(name: str = None, description: str = None)[source]

Base class for Automation Triggers.

This class serves as a blueprint for creating automation triggers.

Initialization

Initialize the AutomationTrigger.

Parameters:
  • name – The name of the trigger.

  • description – The description of the trigger.

__repr__()[source]

Return a string representation of the AutomationTrigger.

Returns:

A string representation of the AutomationTrigger.

Return type:

str

abstractmethod check_trigger() bool[source]

Check if the trigger is satisfied.

Returns:

True if the trigger is satisfied, otherwise False.

Return type:

bool

Raises:

NotImplementedError – This method should be implemented in a subclass.

duck.automation.trigger.NoTrigger

‘NoTriggerBase(…)’

class duck.automation.trigger.NoTriggerBase(name: str = None, description: str = None)[source]

Bases: duck.automation.trigger.AutomationTrigger

A trigger that always returns True.

This trigger can be used in scenarios where no specific trigger condition is required.

Initialization

Initialize the AutomationTrigger.

Parameters:
  • name – The name of the trigger.

  • description – The description of the trigger.

check_trigger() bool[source]

Check if the trigger is satisfied.

Returns:

Always returns True.

Return type:

bool