change name to daikin

This commit is contained in:
reaw55 2024-03-09 12:16:38 +07:00
parent 8fcd1b1ad7
commit 5364be1d18

View file

@ -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);