From 5364be1d1873b437811d1eb4a079c031647f8bda Mon Sep 17 00:00:00 2001 From: reaw55 <58457329+reaw55@users.noreply.github.com> Date: Sat, 9 Mar 2024 12:16:38 +0700 Subject: [PATCH] change name to daikin --- src/main.cpp | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e0e1147..8e4c01d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ const uint8_t light_array[4][2] = { {LIGHT_ROW4_COLUMN1, LIGHT_ROW4_COLUMN2}}; -AirConditioner ac = { +AirConditioner ac_daikin = { .max_temperature = 32, .min_temperature = 16, .modes = 4, @@ -26,6 +26,15 @@ AirConditioner ac = { .fan_speeds = 4, .fan_speed_names = fan_speed_names, .getInfraredCode = &getInfraredCode}; + +AirConditioner ac_york = { + .max_temperature = 30, + .min_temperature = 18, + .modes = 3, + .mode_names = mode_names, + .fan_speeds = 4, + .fan_speed_names = fan_speed_names, + .getInfraredCode = &getInfraredCode}; /*********************************************** * End Configuration * ***********************************************/ @@ -33,7 +42,11 @@ AirConditioner ac = { ESPMegaPRO espmega = ESPMegaPRO(); ISEDisplay iseDisplay = ISEDisplay(&iseDisplayAdapter, &light_array[0][0], row, column); -ClimateCard climateCard = ClimateCard(AIR_CONDITIONER_IR_PIN, ac, +ClimateCard climateCard_daikin = ClimateCard(AIR_CONDITIONER_IR_PIN, ac_daikin, + AIR_CONDITIONER_SENSOR_TYPE, AIR_CONDITIONER_SENSOR_PIN, + AIR_CONDITIONER_RMT_CHANNEL); + +ClimateCard climateCard_york = ClimateCard(AIR_CONDITIONER_IR_PIN, ac_york, AIR_CONDITIONER_SENSOR_TYPE, AIR_CONDITIONER_SENSOR_PIN, AIR_CONDITIONER_RMT_CHANNEL); @@ -108,11 +121,11 @@ void setup() { espmega.outputs.setValue(i, 4095); } - espmega.installCard(2, &climateCard); - climateCard.bindFRAM(&espmega.fram, 5000); - climateCard.loadStateFromFRAM(); - climateCard.setFRAMAutoSave(true); - espmega.display->bindClimateCard(&climateCard); + espmega.installCard(2, &climateCard_daikin); + climateCard_daikin.bindFRAM(&espmega.fram, 5000); + climateCard_daikin.loadStateFromFRAM(); + climateCard_daikin.setFRAMAutoSave(true); + espmega.display->bindclimateCard_daikin(&climateCard_daikin); // auto binded_display_update_on_pm25_out = std::bind(&display_update,0,std::placeholders::_1); // auto binded_display_update_on_pm25_in = std::bind(&display_update,1,std::placeholders::_1); // auto binded_display_update_on_temp_out = std::bind(&display_update,2,std::placeholders::_1); @@ -157,7 +170,7 @@ void setup() espmega.iot->registerCard(1); // Register the Output Card espmega.iot->registerCard(2); // Register the Climate Card auto bindedGetTime = std::bind(&ESPMegaPRO::getTime, &espmega); - iseDisplay.begin(&espmega.inputs, &espmega.outputs, &climateCard, &pm_switch, &pm_fan_speed); + iseDisplay.begin(&espmega.inputs, &espmega.outputs, &climateCard_daikin, &pm_switch, &pm_fan_speed); espmega.iot->registerRelativeMqttCallback(&handleMqttMessage); iseDisplay.registerPageChangeCallback(&handlePageChange);