Compare commits

...

1 Commits

Author SHA1 Message Date
Siwat Sirichai e59c00b46e initial structure 2023-12-03 23:27:42 +07:00
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#include <espmega_iot_homeassistant.hpp>
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) {
}

View File

@ -0,0 +1,22 @@
#pragma once
#include <PubSubClient.h>
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;
};