Implement Response object

This commit is contained in:
Edward Brown 2023-09-05 15:49:45 +01:00
parent afa30b72b4
commit 08097f816c
5 changed files with 39 additions and 3 deletions

View file

@ -101,6 +101,12 @@ class Control:
platform = self.schema.get(capability_id).get(platform_id)
output = platform.handle(message)
if output == 'DO_NOT_SEND':
logging.warning(
f'Topic {message.topic.value} callback responded with send=False. Will not publish response.')
return
topic = str(platform.get_topic_publish())
await log_publish(client, topic, output)