it fucking builds!
This commit is contained in:
parent
f2c0eb6bf1
commit
e5ecd5f3a0
5 changed files with 162 additions and 272 deletions
13
src/main.cpp
13
src/main.cpp
|
|
@ -1,5 +1,6 @@
|
|||
#include <main.hpp>
|
||||
#include <cud_display.hpp>
|
||||
#include <ise_display.hpp>
|
||||
|
||||
/***********************************************
|
||||
* Begin Configuration *
|
||||
|
|
@ -38,6 +39,7 @@ AirConditioner ac = {
|
|||
|
||||
ESPMegaPRO espmega = ESPMegaPRO();
|
||||
CUDDisplay cudDisplay = CUDDisplay(&cudDisplayAdapter);
|
||||
ISEDisplay iseDisplay = ISEDisplay(&cudDisplayAdapter);
|
||||
|
||||
ClimateCard climateCard = ClimateCard(AIR_CONDITIONER_IR_PIN, ac,
|
||||
AIR_CONDITIONER_SENSOR_TYPE, AIR_CONDITIONER_SENSOR_PIN,
|
||||
|
|
@ -49,6 +51,7 @@ void handleMqttMessage(char *topic, char *payload)
|
|||
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))
|
||||
{
|
||||
|
|
@ -167,6 +170,16 @@ void loop()
|
|||
{
|
||||
espmega.loop();
|
||||
cudDisplay.loop();
|
||||
iseDisplay.loop();
|
||||
|
||||
// Update the time every 15 seconds
|
||||
static uint32_t last_time_updated = 0;
|
||||
if (millis() - last_time_updated > 15000)
|
||||
{
|
||||
rtctime_t time = espmega.getTime();
|
||||
iseDisplay.updateDateTimeText(time);
|
||||
last_time_updated = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void on_pin_change(uint8_t pin, uint8_t value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue