mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-11 13:15:37 +00:00
24 lines
639 B
C
24 lines
639 B
C
|
|
#include "../cJSON/cJSON.h"
|
|
|
|
typedef enum {
|
|
ENTITY_RELAY = 0,
|
|
ENTITY_LIGHT = 1
|
|
} ENTITY_TYPE;
|
|
|
|
/// @brief HomeAssistant device discovery information
|
|
typedef struct HassDeviceInfo_s{
|
|
char *unique_id;
|
|
char *channel;
|
|
char *json;
|
|
cJSON *root;
|
|
cJSON *device;
|
|
cJSON *ids;
|
|
} HassDeviceInfo;
|
|
|
|
char *hass_build_unique_id(ENTITY_TYPE type, int index);
|
|
char *hass_build_unique_id(ENTITY_TYPE type, int index);
|
|
char *hass_build_discovery_json(HassDeviceInfo *info);
|
|
HassDeviceInfo *hass_init_device_info(ENTITY_TYPE type, int index, char *payload_on, char *payload_off);
|
|
void hass_free_device_info(HassDeviceInfo *info);
|