convert example & homeassistant specific configs to a generic with all optional fields

This commit is contained in:
Mikhail Epifanov
2024-01-17 22:25:02 +01:00
parent 245787b89e
commit 409c0295ec
20 changed files with 159 additions and 316 deletions

View File

@@ -1,9 +1,13 @@
from abc import ABC, abstractmethod
from cookbook.models import ShoppingListEntry, Space
from cookbook.models import ShoppingListEntry, Space, ConnectorConfig
class Connector(ABC):
@abstractmethod
def __init__(self, config: ConnectorConfig):
pass
@abstractmethod
async def on_shopping_list_entry_created(self, space: Space, instance: ShoppingListEntry) -> None:
pass
@@ -20,5 +24,4 @@ class Connector(ABC):
async def close(self) -> None:
pass
# TODO: Maybe add an 'IsEnabled(self) -> Bool' to here
# TODO: Add Recipes & possibly Meal Place listeners/hooks (And maybe more?)