Some renaming
This commit is contained in:
@@ -10,7 +10,7 @@ from src.config import Config
|
||||
|
||||
|
||||
class HomeAssistant:
|
||||
class PublishMessage(BaseModel):
|
||||
class Message(BaseModel):
|
||||
target: str
|
||||
action: str
|
||||
content: str
|
||||
@@ -18,13 +18,13 @@ class HomeAssistant:
|
||||
def __init__(self, ticktick: TickTick) -> None:
|
||||
self._ticktick = ticktick
|
||||
|
||||
def process_publish_message(self, message: PublishMessage) -> dict[str, str]:
|
||||
def process_message(self, message: Message) -> dict[str, str]:
|
||||
if message.target == "ticktick":
|
||||
return self._process_ticktick_message(message=message)
|
||||
|
||||
return {"Status": "Unknown target"}
|
||||
|
||||
def _process_ticktick_message(self, message: PublishMessage) -> dict[str, str]:
|
||||
def _process_ticktick_message(self, message: Message) -> dict[str, str]:
|
||||
if message.action == "create_shopping_list":
|
||||
return self._create_shopping_list(content=message.content)
|
||||
if message.action == "create_action_task":
|
||||
|
||||
Reference in New Issue
Block a user