mqtt real_time_power

This commit is contained in:
zogodo
2020-02-16 19:04:10 +08:00
parent 8a53b2179b
commit 412342efe8
4 changed files with 8 additions and 8 deletions

View File

@@ -621,7 +621,7 @@ void UserMqttHassPower(void)
if (send_buf != NULL && topic_buf != NULL)
{
sprintf(topic_buf, "homeassistant/sensor/%s/power/state", str_mac);
sprintf(send_buf, "{\"power\":\"%d.%d\"}", (int)(power/10), (int)(power%10));
sprintf(send_buf, "{\"power\":\"%d.%d\"}", (int)(real_time_power/10), (int)(real_time_power%10));
UserMqttSendTopic(topic_buf, send_buf, 0);
}
if (send_buf) free(send_buf);