mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-06 18:32:49 +08:00
修复编译警告
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
|
||||
#define POWER_INFO_JSON "{'sockets':'%s','idx':%d,'len':%d,'p_count':%ld,'powers':[%s],'up_time':'%s','led_enabled':%d,'total_switch_on':%d,'socketNames':'%s','p_count_1_day_ago':%d,'p_count_2_days_ago':%d,'child_lock_enabled':%d,'deviceName':'%s','btnClicks':%s}"
|
||||
|
||||
int AppHttpdStart(void);
|
||||
extern int AppHttpdStart(void);
|
||||
|
||||
int AppHttpdStop();
|
||||
extern int AppHttpdStop();
|
||||
|
||||
|
||||
@@ -208,8 +208,6 @@ int application_start(void) {
|
||||
if (user_config->task_top && now >= user_config->task_top->prs_time) {
|
||||
ProcessTask();
|
||||
}
|
||||
|
||||
if (now % 10 == 5) system_log("Free memory %d bytes", MicoGetMemoryInfo()->free_memory);
|
||||
mico_thread_msleep(1000);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#define wifi_log(M, ...) custom_log("WIFI", M, ##__VA_ARGS__); web_log("WIFI", M, ##__VA_ARGS__);
|
||||
#define power_log(M, ...) custom_log("POWER", M, ##__VA_ARGS__); web_log("POWER", M, ##__VA_ARGS__);
|
||||
|
||||
#define VERSION "v2.2.4"
|
||||
#define VERSION "v2.1.8"
|
||||
|
||||
#define TYPE 1
|
||||
#define TYPE_NAME "TC1"
|
||||
|
||||
@@ -105,9 +105,6 @@ OSStatus UserMqttDeInit(void) {
|
||||
// 1. 请求线程退出
|
||||
mqtt_thread_should_exit = true;
|
||||
|
||||
exit:
|
||||
if (kNoErr != err)
|
||||
mqtt_log("ERROR: UserMqttDeInit exit err: %d", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -790,7 +787,7 @@ void UserMqttHassAutoPower(void) {
|
||||
char topic_buf[128] = {0};
|
||||
char send_buf[128] = {0};
|
||||
|
||||
void UserMqttHassPower(void) {
|
||||
extern void UserMqttHassPower(void) {
|
||||
sprintf(topic_buf, "homeassistant/sensor/%s/power/state", str_mac);
|
||||
sprintf(send_buf, "{\"power\":\"%.3f\"}", real_time_power / 10);
|
||||
UserMqttSendTopic(topic_buf, send_buf, 0);
|
||||
|
||||
@@ -39,17 +39,11 @@ OSStatus system_discovery_init( system_context_t * const inContext )
|
||||
init.service_name = "_easylink._tcp.local.";
|
||||
|
||||
/* name#xxxxxx.local. */
|
||||
snprintf( temp_txt, 100, "%s#%c%c%c%c%c%c.local.", inContext->flashContentInRam.micoSystemConfig.name,
|
||||
inContext->micoStatus.mac[9], inContext->micoStatus.mac[10], \
|
||||
inContext->micoStatus.mac[12], inContext->micoStatus.mac[13], \
|
||||
inContext->micoStatus.mac[15], inContext->micoStatus.mac[16] );
|
||||
snprintf( temp_txt, 100, "%s.local.", inContext->flashContentInRam.micoSystemConfig.name);
|
||||
init.host_name = (char*)__strdup(temp_txt);
|
||||
|
||||
/* name#xxxxxx. */
|
||||
snprintf( temp_txt, 100, "%s#%c%c%c%c%c%c", inContext->flashContentInRam.micoSystemConfig.name,
|
||||
inContext->micoStatus.mac[9], inContext->micoStatus.mac[10], \
|
||||
inContext->micoStatus.mac[12], inContext->micoStatus.mac[13], \
|
||||
inContext->micoStatus.mac[15], inContext->micoStatus.mac[16] );
|
||||
snprintf( temp_txt, 100, "%s", inContext->flashContentInRam.micoSystemConfig.name);
|
||||
init.instance_name = (char*)__strdup(temp_txt);
|
||||
|
||||
#ifndef MICO_LOCAL_SERVER_PORT
|
||||
|
||||
Reference in New Issue
Block a user