mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-22 23:26:58 +01:00
Formatted
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
|
||||
typedef enum {
|
||||
ENTITY_RELAY = 0,
|
||||
ENTITY_LIGHT_PWM = 1,
|
||||
ENTITY_LIGHT_RGB = 2,
|
||||
ENTITY_LIGHT_RGBCW = 3,
|
||||
ENTITY_SENSOR = 4,
|
||||
ENTITY_LIGHT_PWM = 1,
|
||||
ENTITY_LIGHT_RGB = 2,
|
||||
ENTITY_LIGHT_RGBCW = 3,
|
||||
ENTITY_SENSOR = 4,
|
||||
} ENTITY_TYPE;
|
||||
|
||||
//unique_id is defined in hass_populate_unique_id and is based on CFG_GetDeviceName() whose size is CGF_DEVICE_NAME_SIZE.
|
||||
@@ -24,18 +24,18 @@ typedef enum {
|
||||
#define HASS_JSON_SIZE (MQTT_PUBLISH_ITEM_VALUE_LENGTH - 1)
|
||||
|
||||
/// @brief HomeAssistant device discovery information
|
||||
typedef struct HassDeviceInfo_s{
|
||||
char unique_id[HASS_UNIQUE_ID_SIZE];
|
||||
char channel[HASS_CHANNEL_SIZE];
|
||||
char json[HASS_JSON_SIZE];
|
||||
typedef struct HassDeviceInfo_s {
|
||||
char unique_id[HASS_UNIQUE_ID_SIZE];
|
||||
char channel[HASS_CHANNEL_SIZE];
|
||||
char json[HASS_JSON_SIZE];
|
||||
|
||||
cJSON *root;
|
||||
cJSON *device;
|
||||
cJSON *ids;
|
||||
cJSON* root;
|
||||
cJSON* device;
|
||||
cJSON* ids;
|
||||
} HassDeviceInfo;
|
||||
|
||||
void hass_print_unique_id(http_request_t *request, const char *fmt, ENTITY_TYPE type, int index);
|
||||
HassDeviceInfo *hass_init_relay_device_info(int index);
|
||||
HassDeviceInfo *hass_init_light_device_info(ENTITY_TYPE type, int index);
|
||||
char *hass_build_discovery_json(HassDeviceInfo *info);
|
||||
void hass_free_device_info(HassDeviceInfo *info);
|
||||
void hass_print_unique_id(http_request_t* request, const char* fmt, ENTITY_TYPE type, int index);
|
||||
HassDeviceInfo* hass_init_relay_device_info(int index);
|
||||
HassDeviceInfo* hass_init_light_device_info(ENTITY_TYPE type, int index);
|
||||
char* hass_build_discovery_json(HassDeviceInfo* info);
|
||||
void hass_free_device_info(HassDeviceInfo* info);
|
||||
|
||||
Reference in New Issue
Block a user