mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
Add ConnectorManager component which allows for Connectors to listen to triggers and do actions on them. Also add HomeAssistantConfig which stores the configuration for the HomeAssistantConnector
This commit is contained in:
41
cookbook/connectors/connector.py
Normal file
41
cookbook/connectors/connector.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
from cookbook.models import ShoppingListEntry, Space
|
||||
|
||||
|
||||
class Connector(ABC):
|
||||
@abstractmethod
|
||||
async def on_shopping_list_entry_created(self, space: Space, instance: ShoppingListEntry) -> None:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def on_shopping_list_entry_updated(self, space: Space, instance: ShoppingListEntry) -> None:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def on_shopping_list_entry_deleted(self, space: Space, instance: ShoppingListEntry) -> None:
|
||||
pass
|
||||
|
||||
# @abstractmethod
|
||||
# def on_recipe_created(self, instance: Recipe, **kwargs) -> None:
|
||||
# pass
|
||||
#
|
||||
# @abstractmethod
|
||||
# def on_recipe_updated(self, instance: Recipe, **kwargs) -> None:
|
||||
# pass
|
||||
#
|
||||
# @abstractmethod
|
||||
# def on_recipe_deleted(self, instance: Recipe, **kwargs) -> None:
|
||||
# pass
|
||||
#
|
||||
# @abstractmethod
|
||||
# def on_meal_plan_created(self, instance: MealPlan, **kwargs) -> None:
|
||||
# pass
|
||||
#
|
||||
# @abstractmethod
|
||||
# def on_meal_plan_updated(self, instance: MealPlan, **kwargs) -> None:
|
||||
# pass
|
||||
#
|
||||
# @abstractmethod
|
||||
# def on_meal_plan_deleted(self, instance: MealPlan, **kwargs) -> None:
|
||||
# pass
|
||||
Reference in New Issue
Block a user