From e59c00b46e370ab4c46c614e52b5f1a68c683a42 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sun, 3 Dec 2023 23:27:42 +0700 Subject: [PATCH] initial structure --- src/espmega_iot_homeassistant.cpp | 24 ++++++++++++++++++++++++ src/espmega_iot_homeassistant.hpp | 22 ++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/espmega_iot_homeassistant.cpp b/src/espmega_iot_homeassistant.cpp index e69de29..fe534ed 100644 --- a/src/espmega_iot_homeassistant.cpp +++ b/src/espmega_iot_homeassistant.cpp @@ -0,0 +1,24 @@ +#include +void homeassistant_setup() { + +} +void homeassistant_loop() { + +} +void homeassistant_mqtt_callback(char* topic, uint8_t topic_length, char* payload, unsigned int payload_length) { + +} + +char* homeassistant_get_state(char* entity_id) { + +} +void homeassistant_set_state(char* entity_id, char* state) { + +} + +char* homeassistant_get_attributes(char* entity_id, char* attribute_name) { + +} +void homeassistant_set_attributes(char* entity_id, char* attribute_name, char* value) { + +} \ No newline at end of file diff --git a/src/espmega_iot_homeassistant.hpp b/src/espmega_iot_homeassistant.hpp index e69de29..8eb0511 100644 --- a/src/espmega_iot_homeassistant.hpp +++ b/src/espmega_iot_homeassistant.hpp @@ -0,0 +1,22 @@ +#pragma once +#include + +extern PubSubClient mqtt; +extern bool standalone; +extern char MQTT_BASE_TOPIC[]; + +void homeassistant_setup(); +void homeassistant_loop(); + +void homeassistant_mqtt_callback(char* topic, uint8_t topic_length, char* payload, unsigned int payload_length); + +char* homeassistant_get_state(char* entity_id); +void homeassistant_set_state(char* entity_id, char* state); + +char* homeassistant_get_attributes(char* entity_id, char* attribute_name); +void homeassistant_set_attributes(char* entity_id, char* attribute_name, char* value); + +struct homeassistant_entity { + char* entity_id; + char* mqtt_topic; +}; \ No newline at end of file