create hmi and define component

This commit is contained in:
reaw55 2024-01-30 20:51:12 +07:00
parent 8a19674b0e
commit f2c0eb6bf1
86 changed files with 643 additions and 0 deletions

View file

@ -45,6 +45,10 @@ ClimateCard climateCard = ClimateCard(AIR_CONDITIONER_IR_PIN, ac,
void handleMqttMessage(char *topic, char *payload)
{
char *temperature = (char*)calloc(16,sizeof(char));
strcpy(temperature, payload);
int temp_int;
temp_int = atoi(temperature);
Serial.printf("MQTT Message: %s %s\n", topic, payload);
if (!strcmp(topic, AIR_CONDITIONER_LOCK_SET_RELATIVE_TOPIC))
{
@ -59,6 +63,7 @@ void handleMqttMessage(char *topic, char *payload)
espmega.iot->publishRelative(AIR_CONDITIONER_LOCK_RELATIVE_TOPIC, "unlock");
}
}
free(temperature);
}
void lockAC()