change the ac state to correct mode

This commit is contained in:
reaw55 2024-03-30 14:56:50 +07:00
parent 20d38ec7ac
commit 21948a86d8
2 changed files with 26 additions and 27 deletions

View file

@ -245,24 +245,23 @@ void loop()
{
espmega.loop();
iseDisplay.loop();
//loop set york ac state between 21 and 22 degree every 5 seconds
static uint32_t last_ac_update = 0;
if (millis() - last_ac_update > 5000)
{
uint8_t ac_temperature = climateCard_york.getTemperature();
if (ac_temperature == 21)
{
ESP_LOGV("AC", "Setting AC temperature to 22");
climateCard_york.setTemperature(22);
}
else
{
ESP_LOGV("AC", "Setting AC temperature to 21");
climateCard_york.setTemperature(21);
}
last_ac_update = millis();
}
// //loop set york ac state between 21 and 22 degree and mode to 1 every 5 seconds
// static uint32_t last_ac_update = 0;
// if (millis() - last_ac_update > 5000)
// {
// uint8_t ac_temperature = climateCard_york.getTemperature();
// if (ac_temperature == 21)
// {
// ESP_LOGV("AC", "Setting AC temperature to 22");
// climateCard_york.setState(2, 1, 22);
// }
// else
// {
// ESP_LOGV("AC", "Setting AC temperature to 21");
// climateCard_york.setState(2, 1, 21);
// }
// last_ac_update = millis();
// }
// Update the time every 15 seconds