mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-01 13:08:48 +00:00
Added support for RGB
This commit is contained in:
@ -6,10 +6,15 @@
|
||||
|
||||
typedef enum {
|
||||
ENTITY_RELAY = 0,
|
||||
ENTITY_LIGHT = 1
|
||||
ENTITY_LIGHT_PWM = 1,
|
||||
ENTITY_LIGHT_RGB = 2,
|
||||
ENTITY_LIGHT_RGBCW = 3,
|
||||
ENTITY_SENSOR = 4,
|
||||
} ENTITY_TYPE;
|
||||
|
||||
//unique_id is based on CFG_GetDeviceName() whose size is CGF_DEVICE_NAME_SIZE (see hass_populate_unique_id)
|
||||
//unique_id is defined in hass_populate_unique_id and is based on CFG_GetDeviceName() whose size is CGF_DEVICE_NAME_SIZE.
|
||||
//Sample unique_id would be deviceName_entityType_index.
|
||||
//Currently supported entityType is `relay` or `light` - 5 char.
|
||||
#define HASS_UNIQUE_ID_SIZE (CGF_DEVICE_NAME_SIZE + 1 + 5 + 1 + 4)
|
||||
|
||||
//channel is based on unique_id (see hass_populate_device_config_channel)
|
||||
@ -30,6 +35,7 @@ typedef struct HassDeviceInfo_s{
|
||||
} HassDeviceInfo;
|
||||
|
||||
void hass_print_unique_id(http_request_t *request, const char *fmt, ENTITY_TYPE type, int index);
|
||||
HassDeviceInfo *hass_init_device_info(ENTITY_TYPE type, int index, char *payload_on, char *payload_off);
|
||||
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