mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-14 22:18:14 +08:00
去除初始化AP的密码
This commit is contained in:
12
TC1/main.c
12
TC1/main.c
@@ -151,12 +151,12 @@ int application_start(void)
|
|||||||
}
|
}
|
||||||
MicoSysLed(0);
|
MicoSysLed(0);
|
||||||
|
|
||||||
// if (user_config->version != USER_CONFIG_VERSION)
|
if (user_config->version != USER_CONFIG_VERSION)
|
||||||
// {
|
{
|
||||||
// tc1_log("WARNGIN: user params restored!");
|
tc1_log("WARNGIN: user params restored!");
|
||||||
// err = mico_system_context_restore(sys_config);
|
err = mico_system_context_restore(sys_config);
|
||||||
// require_noerr(err, exit);
|
require_noerr(err, exit);
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (sys_config->micoSystemConfig.name[0] == 1)
|
if (sys_config->micoSystemConfig.name[0] == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -547,6 +547,7 @@ void UserMqttHassPower(void)
|
|||||||
sprintf(send_buf, "{\"powerConsumption\":\"%.3f\"}", (17.1 * p_count) / 1000 / 36000);
|
sprintf(send_buf, "{\"powerConsumption\":\"%.3f\"}", (17.1 * p_count) / 1000 / 36000);
|
||||||
UserMqttSendTopic(topic_buf, send_buf, 0);
|
UserMqttSendTopic(topic_buf, send_buf, 0);
|
||||||
|
|
||||||
|
// tc1_log("p_count %ld, p_count_1_day_ago %ld ,p_count_2_days_ago %ld, result %ld",p_count,user_config->p_count_1_day_ago,user_config->p_count_2_days_ago,((p_count-user_config->p_count_1_day_ago)<0?0:(p_count-user_config->p_count_1_day_ago)));
|
||||||
sprintf(topic_buf, "homeassistant/sensor/%s/powerConsumptionToday/state", str_mac);
|
sprintf(topic_buf, "homeassistant/sensor/%s/powerConsumptionToday/state", str_mac);
|
||||||
sprintf(send_buf, "{\"powerConsumptionToday\":\"%.3f\"}", (17.1 * ((p_count-user_config->p_count_1_day_ago)<0?0:(p_count-user_config->p_count_1_day_ago))) / 1000 / 36000);
|
sprintf(send_buf, "{\"powerConsumptionToday\":\"%.3f\"}", (17.1 * ((p_count-user_config->p_count_1_day_ago)<0?0:(p_count-user_config->p_count_1_day_ago))) / 1000 / 36000);
|
||||||
UserMqttSendTopic(topic_buf, send_buf, 0);
|
UserMqttSendTopic(topic_buf, send_buf, 0);
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ void ApInit(bool use_defaul)
|
|||||||
{
|
{
|
||||||
sprintf(user_config->ap_name, ZZ_AP_NAME, str_mac + 6);
|
sprintf(user_config->ap_name, ZZ_AP_NAME, str_mac + 6);
|
||||||
sprintf(user_config->ap_key, "%s", ZZ_AP_KEY);
|
sprintf(user_config->ap_key, "%s", ZZ_AP_KEY);
|
||||||
wifi_log("ApInit use_defaul[true] key[12345678]");
|
wifi_log("ApInit use_defaul[true] key[]");
|
||||||
}
|
}
|
||||||
|
|
||||||
network_InitTypeDef_st wNetConfig;
|
network_InitTypeDef_st wNetConfig;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define ZZ_AP_NAME "TC1-AP-%s"
|
#define ZZ_AP_NAME "TC1-AP-%s"
|
||||||
#define ZZ_AP_KEY "12345678"
|
#define ZZ_AP_KEY ""
|
||||||
#define ZZ_AP_LOCAL_IP "192.168.0.1"
|
#define ZZ_AP_LOCAL_IP "192.168.0.1"
|
||||||
#define ZZ_AP_DNS_SERVER "192.168.0.1"
|
#define ZZ_AP_DNS_SERVER "192.168.0.1"
|
||||||
#define ZZ_AP_NET_MASK "255.255.255.0"
|
#define ZZ_AP_NET_MASK "255.255.255.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user