Skip to content

Commit

Permalink
Merge pull request #187 from ezloteam/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
lomasSE89 authored Sep 19, 2024
2 parents 341e2f6 + 0c4f3d9 commit 1dcb0cb
Show file tree
Hide file tree
Showing 338 changed files with 7,655 additions and 5,659 deletions.
20 changes: 20 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@

# RELEASE NOTES

# Version 4.1.6 Build 196

## New

1. Add remaining 'device/item_group' - comparison features in 'when' & 'then' [EZPI-437](https://jira.mios.com/browse/EZPI-437)
2. Implement isGroupItem_group : when-method [EZPI-464](https://jira.mios.com/browse/EZPI-464)
3. add expression-update feature when using 'hub.scenes.expressions.set'. [EZPI-465](https://jira.mios.com/browse/EZPI-465)
4. Implement Group_set_Item_value then-method [EZPI-456](https://jira.mios.com/browse/EZPI-456)
5. Implement Group_set_Device_armed then-method [EZPI-457](https://jira.mios.com/browse/EZPI-457)
6. Implement Group_toggle_value then-method [EZPI-458](https://jira.mios.com/browse/EZPI-458)

## Fixes

1. Avoid HTTP Requests if there is no valid HTTP/S URL [EZPI-474](https://jira.mios.com/browse/EZPI-474)
2. Issues when distinguishing between 'expression' and 'variable'. [EZPI-476](https://jira.mios.com/browse/EZPI-476)
3. Duplication of Expression/Variable with same name. [EZPI-475](https://jira.mios.com/browse/EZPI-475)
4. BLE Onboarding, cJSON incorrect cert length [EZPI-491](https://jira.mios.com/browse/EZPI-491)
5. Scenes with three or more triggers are not created - broadcasts about the successful creation of the scene are not received. [EZPI-320](https://jira.mios.com/browse/EZPI-320)
6. Bug found when triggering 'hub.device.room.set' [EZPI-473](https://jira.mios.com/browse/EZPI-473)

# Version 4.1.5 Build 195

## New
Expand Down
6 changes: 4 additions & 2 deletions ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "stdio.h"
const char *ezlopi_ESP32_str = "ESP32";
const char *ezlopi_ESP32S3_str = "ESP32S3";
const char* ezlopi_ESP32S2_str = "ESP32S2";
const char *ezlopi_ESP32S2_str = "ESP32S2";
const char *ezlopi_ESP32C3_str = "ESP32C3";
const char *ezlopi_ezlopi_str = "ezlopi";
const char *ezlopi__str = "";
Expand Down Expand Up @@ -85,6 +85,7 @@ const char *ezlopi_not_ready_str = "not ready";
const char *ezlopi_settings_str = "settings";
const char *ezlopi_valueType_str = "valueType";
const char *ezlopi_metadata_str = "metadata";
const char *ezlopi_meta_str = "meta";
const char *ezlopi_code_str = "code";
const char *ezlopi_data_str = "data";
const char *ezlopi_message_str = "message";
Expand Down Expand Up @@ -266,7 +267,8 @@ const char *ezlopi_switchToDelay_str = "switchToDelay";
const char *ezlopi_alarmDelay_str = "alarmDelay";
const char *ezlopi_entryDelay_str = "entryDelay";
const char *ezlopi_normal_str = "normal";
const char *ezlopi_short_str = "short";
// const char *ezlopi_short_str = "short";
const char *ezlopi_long_extended_str = "longExtended";
const char *ezlopi_extended_str = "extended";
const char *ezlopi_instant_str = "instant";
const char *ezlopi_modes_str = "modes";
Expand Down
4 changes: 3 additions & 1 deletion ezlopi-cloud/ezlopi-cloud-constants/ezlopi_cloud_keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ extern const char *ezlopi_not_ready_str;
extern const char *ezlopi_settings_str;
extern const char *ezlopi_valueType_str;
extern const char *ezlopi_metadata_str;
extern const char *ezlopi_meta_str;
extern const char *ezlopi_code_str;
extern const char *ezlopi_data_str;
extern const char *ezlopi_message_str;
Expand Down Expand Up @@ -269,7 +270,8 @@ extern const char *ezlopi_switchToDelay_str;
extern const char *ezlopi_alarmDelay_str;
extern const char *ezlopi_entryDelay_str;
extern const char *ezlopi_normal_str;
extern const char *ezlopi_short_str;
// extern const char *ezlopi_short_str;
extern const char *ezlopi_long_extended_str;
extern const char *ezlopi_extended_str;
extern const char *ezlopi_instant_str;
extern const char *ezlopi_modes_str;
Expand Down
6 changes: 3 additions & 3 deletions ezlopi-cloud/ezlopi-cloud-devices/ezlopi_cloud_devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ static char *__generate_sha1_of_src(const char *src)
size_t l = (len - (strlen(ret) + 1));
if (l > 0)
{
((int)sha1[i] / 100 > 0) ? (snprintf(ret + strlen(ret), l, "%u", (uint8_t)sha1[i])) // tripple digit
: ((int)sha1[i] / 10 > 0) ? (snprintf(ret + strlen(ret), l, "0%u", (uint8_t)sha1[i])) // double digit
: (snprintf(ret + strlen(ret), l, "00%u", (uint8_t)sha1[i])); // single digit
((int)sha1[i] / 100 > 0) ? (snprintf(ret + strlen(ret), l, "%u", (uint8_t)sha1[i])) // tripple digit
: ((int)sha1[i] / 10 > 0) ? (snprintf(ret + strlen(ret), l, "0%u", (uint8_t)sha1[i])) // double digit
: (snprintf(ret + strlen(ret), l, "00%u", (uint8_t)sha1[i])); // single digit
}
else
{
Expand Down
11 changes: 11 additions & 0 deletions ezlopi-cloud/ezlopi-cloud-hub-data-list/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

idf_component_register(SRCS "ezlopi_cloud_hub_data_list.c"
INCLUDE_DIRS .
REQUIRES ezlopi-util-trace
cjext
ezlopi-cloud-constants
ezlopi-core-setting-commands
)



Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

#include "cjext.h"
#include "ezlopi_util_trace.h"

#include "ezlopi_core_setting_commands.h"

#include "ezlopi_cloud_constants.h"
#include "ezlopi_cloud_hub_data_list.h"

static void ezlopi_core_hub_data_list_populate_settings_json(cJSON *cj_result_name, const char* field_str, const char *name_str)
{
e_ezlopi_core_setting_command_names_t settings_name_enum = ezlopi_core_setting_command_get_command_enum_from_str(name_str);
switch (settings_name_enum)
{
case SETTING_COMMAND_NAME_SCALE_TEMPERATURE:
{
char *scale_str = (ezlopi_core_setting_get_temperature_scale() == TEMPERATURE_SCALE_FAHRENHEIT) ? "fahrenheit" : "celsius";
cJSON_AddStringToObject(__FUNCTION__, cj_result_name, field_str, scale_str);
break;
}
case SETTING_COMMAND_NAME_DATE_FORMAT:
{
char *date_format = (ezlopi_core_setting_get_date_format() == DATE_FORMAT_MMDDYY) ? "mmddyy" : "ddmmyy";
cJSON_AddStringToObject(__FUNCTION__, cj_result_name, field_str, date_format);
break;
}
case SETTING_COMMAND_NAME_TIME_FORMAT:
{
char *time_format = (ezlopi_core_setting_get_time_format() == TIME_FORMAT_12) ? "12" : "24";
cJSON_AddStringToObject(__FUNCTION__, cj_result_name, field_str, time_format);
break;
}
default:
{
break;
}
}
}

static void ezlopi_core_hub_data_list_process_settings_data_list(cJSON *cj_names, cJSON *cj_include, cJSON *cj_settings)
{
cJSON *cj_include_element = NULL;
cJSON *cj_names_element = NULL;
cJSON_ArrayForEach(cj_names_element, cj_names)
{
cJSON *cj_result_names = cJSON_AddObjectToObject(__FUNCTION__, cj_settings, cj_names_element->valuestring);
if (cj_result_names)
{
cJSON_ArrayForEach(cj_include_element, cj_include)
{
if (0 == strncmp(cj_include_element->valuestring, "value", 6))
{
ezlopi_core_hub_data_list_populate_settings_json(cj_result_names, cj_include_element->valuestring, cj_names_element->valuestring);
}
}
}
}
}

void hub_data_list(cJSON *cj_request, cJSON *cj_response)
{
cJSON *cj_result = cJSON_AddObjectToObject(__FUNCTION__, cj_response, ezlopi_result_str);
if (cj_result)
{
cJSON *cj_params = cJSON_GetObjectItem(__FUNCTION__, cj_request, ezlopi_params_str);
if (cj_params)
{
cJSON *cj_setting_data_list = cJSON_GetObjectItem(__FUNCTION__, cj_params, "settings");
if (cj_setting_data_list)
{
cJSON *cj_settings = cJSON_AddObjectToObject(__FUNCTION__, cj_result, "settings");
cJSON *cj_names_array = cJSON_GetObjectItem(__FUNCTION__, cj_setting_data_list, "names");
if (cj_names_array && cJSON_IsArray(cj_names_array) && cj_settings)
{
cJSON *cj_fileds = cJSON_GetObjectItem(__FUNCTION__, cj_setting_data_list, "fields");
if (cj_fileds)
{
cJSON *cj_include = cJSON_GetObjectItem(__FUNCTION__, cj_fileds, "include");
if (cj_include && cJSON_IsArray(cj_include))
{
ezlopi_core_hub_data_list_process_settings_data_list(cj_names_array, cj_include, cj_settings);
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#ifndef _EZLOPI_CLOUD_DATA_LIST_H_
#define _EZLOPI_CLOUD_DATA_LIST_H_

#include "cjext.h"

void hub_data_list(cJSON *cj_request, cJSON *cj_response);


#endif // _EZLOPI_CLOUD_DATA_LIST_H_




Loading

0 comments on commit 1dcb0cb

Please sign in to comment.