Milestone 1
All function implemented in OOP except WebServer Function. Most missing documentation and comments
This commit is contained in:
parent
e1f0fd5651
commit
d62ffa3606
7 changed files with 10 additions and 29 deletions
|
@ -82,29 +82,17 @@ void InternalDisplay::saveNetworkConfig()
|
|||
// dns_set -> a text input to set the dns
|
||||
// host_set -> a text input to set the hostname
|
||||
|
||||
Serial.println("Saving network config");
|
||||
this->sendStopBytes();
|
||||
|
||||
// Save the ip address
|
||||
IPAddress ip;
|
||||
// 000.000.000.000, 16 characters, 3 dots, 3 characters per octet, 1 null terminator
|
||||
char ip_buffer[30];
|
||||
Serial.println("Getting ip_set.txt");
|
||||
this->sendStopBytes();
|
||||
if(!this->getStringToBuffer("ip_set.txt", ip_buffer, 30))
|
||||
{
|
||||
Serial.println("Failed to get ip_set.txt");
|
||||
this->sendStopBytes();
|
||||
return;
|
||||
}
|
||||
Serial.println("Got ip_set.txt");
|
||||
this->sendStopBytes();
|
||||
|
||||
// Validate the ip address
|
||||
if (!ip.fromString(ip_buffer)) {
|
||||
Serial.println("Invalid ip address");
|
||||
Serial.print("The recieved IP is: ");
|
||||
Serial.println(ip_buffer);
|
||||
this->sendStopBytes();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,8 +175,6 @@ void InternalDisplay::saveMQTTConfig()
|
|||
|
||||
// Save the mqtt use auth
|
||||
uint8_t use_auth = this->getNumber("use_auth.val");
|
||||
Serial.print("use_auth: ");
|
||||
Serial.println(use_auth);
|
||||
this->mqttConfig->mqtt_useauth = use_auth == 1 ? true : false;
|
||||
this->iot->saveMqttConfig();
|
||||
ESP.restart();
|
||||
|
@ -372,7 +358,7 @@ void InternalDisplay::setInputMarker(uint8_t pin, bool state)
|
|||
this->displayAdapter->print("I");
|
||||
this->displayAdapter->print(pin);
|
||||
this->displayAdapter->print(".val=");
|
||||
this->displayAdapter->print(state ? 0 : 1);
|
||||
this->displayAdapter->print(state ? 1 : 0);
|
||||
this->sendStopBytes();
|
||||
}
|
||||
|
||||
|
@ -709,7 +695,6 @@ void InternalDisplay::handleACStateChange(uint8_t mode, uint8_t fan_speed, uint8
|
|||
{
|
||||
// If the climate card is binded to the display and the current page is the AC page
|
||||
// then update the respective AC component
|
||||
Serial.println("AC state changed");
|
||||
if (this->climateCard == nullptr || this->currentPage != INTERNAL_DISPLAY_AC_PAGE)
|
||||
return;
|
||||
this->sendStopBytes();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue