diff --git a/Arduino/CanGrow/CanGrow.ino b/Arduino/CanGrow/CanGrow.ino index 798c6bd..3999e49 100644 --- a/Arduino/CanGrow/CanGrow.ino +++ b/Arduino/CanGrow/CanGrow.ino @@ -133,7 +133,8 @@ void setup() { Webserver_Init(); Serial.printf(":: [SETUP] Usable Pins: %d\n", GPIOindex_length); for(byte i = 0; i < GPIOindex_length; i++) { - Serial.printf(":: [SETUP] Pin Index: %d, GPIO: %d, Notes: %d\n", i, GPIOindex[i].gpio, GPIOindex[i].note); + Serial.printf(":: [SETUP] Pin Index: %d, GPIO: %d, Notes: ", i, GPIOindex[i].gpio); + Serial.println(GPIO_Index_note_descr[GPIOindex[i].note]); } } diff --git a/Arduino/CanGrow/include/CanGrow.h b/Arduino/CanGrow/include/CanGrow.h index ea9e333..12f56db 100644 --- a/Arduino/CanGrow/include/CanGrow.h +++ b/Arduino/CanGrow/include/CanGrow.h @@ -77,7 +77,7 @@ char INPUT_ONLY_descr[] = "IN_ONLY"; char NO_PWM_descr[] = "NO_PWM"; char HIGH_BOOT_descr[] = "B_HIGH"; -const char * GPIO_Index_note[] = { +const char * GPIO_Index_note_descr[] = { NULL, // 0 - no note BOOTFAILS_LOW_descr, // 1 BOOTFAILS_HIGH_descr, // 2 @@ -87,11 +87,61 @@ const char * GPIO_Index_note[] = { HIGH_BOOT_descr, // 6 }; - +/* + * Output Type + */ + +// 0 is unconfigured +const byte Output_Type_total = 4; + const byte OUTPUT_TYPE_GPIO = 1; const byte OUTPUT_TYPE_I2C = 2; const byte OUTPUT_TYPE_WEB = 3; +char OUTPUT_TYPE_GPIO_descr[] = "GPIO"; +char OUTPUT_TYPE_I2C_descr[] = "I2C"; +char OUTPUT_TYPE_WEB_descr[] = "Webcall"; + +const char * Output_Type_descr[] = { + NULL, // 0 - no description because 0 means unconfigured + OUTPUT_TYPE_GPIO_descr, + OUTPUT_TYPE_I2C_descr, + OUTPUT_TYPE_WEB_descr, +}; + +/* + * Output Device + */ +// 0 is unconfigured +const byte Output_Device_total = 7; + +const byte OUTPUT_DEVICE_LIGHT = 1; +const byte OUTPUT_DEVICE_FAN = 2; +const byte OUTPUT_DEVICE_PUMP = 3; +const byte OUTPUT_DEVICE_HUMIDIFIER = 4; +const byte OUTPUT_DEVICE_DEHUMIDIFIER = 5; +const byte OUTPUT_DEVICE_HEATING = 6; + +char OUTPUT_DEVICE_LIGHT_descr[] = "Light"; +char OUTPUT_DEVICE_FAN_descr[] = "Fan"; +char OUTPUT_DEVICE_PUMP_descr[] = "Pump"; +char OUTPUT_DEVICE_HUMIDIFIER_descr[] = "Humidifier"; +char OUTPUT_DEVICE_DEHUMIDIFIER_descr[] = "Dehumidifier"; +char OUTPUT_DEVICE_HEATING_descr[] = "Heating"; + + +const char * Output_Device_descr[] = { + NULL, // 0 - no description because 0 means unconfigured + OUTPUT_DEVICE_LIGHT_descr, + OUTPUT_DEVICE_FAN_descr, + OUTPUT_DEVICE_PUMP_descr, + OUTPUT_DEVICE_HUMIDIFIER_descr, + OUTPUT_DEVICE_DEHUMIDIFIER_descr, + OUTPUT_DEVICE_HEATING_descr, +}; + + + struct GPIO_Index { const byte gpio; const byte note; @@ -146,9 +196,9 @@ struct Config_System_Output { * - gpio_invert: invert gpio output * - gpio_pwm: enable pwm for output * - i2c: - * - web_host: ip to smart plug (tasmota e.g.) - * - web_req_on: GET request path to turn ON - * - web_req_off: GET request path to turn ON + * - webcall_host: ip to smart plug (tasmota e.g.) + * - webcall_path_on: GET request path to turn ON + * - webcall_path_off: GET request path to turn OFF * */ @@ -160,9 +210,9 @@ struct Config_System_Output { bool gpio_invert[Max_Outputs]; bool gpio_pwm[Max_Outputs]; char i2c[Max_Outputs][8]; - char web_host[Max_Outputs][32]; - char web_req_on[Max_Outputs][32]; - char web_req_off[Max_Outputs][32]; + char webcall_host[Max_Outputs][32]; + char webcall_path_on[Max_Outputs][32]; + char webcall_path_off[Max_Outputs][32]; }; /* main System struct */ diff --git a/Arduino/CanGrow/include/CanGrow_LittleFS.h b/Arduino/CanGrow/include/CanGrow_LittleFS.h index 4f54291..e8cbdd3 100644 --- a/Arduino/CanGrow/include/CanGrow_LittleFS.h +++ b/Arduino/CanGrow/include/CanGrow_LittleFS.h @@ -221,9 +221,9 @@ bool LoadConfig() { // i2c strlcpy(config.system.output.i2c[i], objSystemOutput["i2c"][i], sizeof(config.system.output.i2c[i])); // web - strlcpy(config.system.output.web_host[i], objSystemOutput["web_host"][i], sizeof(config.system.output.web_host[i])); - strlcpy(config.system.output.web_req_on[i], objSystemOutput["web_req_on"][i], sizeof(config.system.output.web_req_on[i])); - strlcpy(config.system.output.web_req_off[i], objSystemOutput["web_req_off"][i], sizeof(config.system.output.web_req_off[i])); + strlcpy(config.system.output.webcall_host[i], objSystemOutput["webcall_host"][i], sizeof(config.system.output.webcall_host[i])); + strlcpy(config.system.output.webcall_path_on[i], objSystemOutput["webcall_path_on"][i], sizeof(config.system.output.webcall_path_on[i])); + strlcpy(config.system.output.webcall_path_off[i], objSystemOutput["webcall_path_off"][i], sizeof(config.system.output.webcall_path_off[i])); } } @@ -301,9 +301,9 @@ bool SaveConfig(bool writeToSerial = false) { // i2c objSystemOutput["i2c"][i] = config.system.output.i2c[i]; // web - objSystemOutput["web_host"][i] = config.system.output.web_host[i]; - objSystemOutput["web_req_on"][i] = config.system.output.web_req_on[i]; - objSystemOutput["web_req_off"][i] = config.system.output.web_req_off[i]; + objSystemOutput["webcall_host"][i] = config.system.output.webcall_host[i]; + objSystemOutput["webcall_path_on"][i] = config.system.output.webcall_path_on[i]; + objSystemOutput["webcall_path_off"][i] = config.system.output.webcall_path_off[i]; } } diff --git a/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h b/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h index fd374f5..367cef8 100644 --- a/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h +++ b/Arduino/CanGrow/include/Webserver/File_cangrow_CSS.h @@ -64,6 +64,7 @@ h3 { td { text-align: left; vertical-align: middle; + border-bottom: 1px solid #262B27; } a:link, a:visited { diff --git a/Arduino/CanGrow/include/Webserver/Page_system.h b/Arduino/CanGrow/include/Webserver/Page_system.h index 06751e3..5b6fff3 100644 --- a/Arduino/CanGrow/include/Webserver/Page_system.h +++ b/Arduino/CanGrow/include/Webserver/Page_system.h @@ -312,9 +312,9 @@ String Proc_WebPage_system_output(const String& var) { output_tr_td += "