26 const int& numberOfColumns,
27 const int& numberOfRows)
28 : lcd::MenuView(
display,
"ConfigurationServerView",
encoder,
"Open in Browser:", numberOfColumns, numberOfRows) {}
48 if (menuItems.empty()) {
51 createMenuItem(
"http://" + WiFi.localIP().toString(), [
this](MenuItem*) {});
52 createMenuItem(
"Change Wifi Settings", [
this](MenuItem*) {
56 createMenuItem(
"Back", [
this](MenuItem*) {
57 activatePreviousView();
61 lcd::MenuView::activate();
70 virtual void tick(
const bool& forceRedraw) {
71 static unsigned long nextCheck = millis();
73 if (nextCheck < millis()) {
74 static String ip =
"";
75 String tmpIp = WiFi.localIP().toString();
78 menuItems.front().setText(
"http://" + tmpIp);
80 nextCheck = millis() + 100;
82 lcd::MenuView::tick(forceRedraw);
static Configuration & getSingleton()
Get the Singleton object.
Definition: Configuration.h:162
void setWifiSettings(const String &ssid, const String &pwd)
Set the Wifi Settings.
Definition: Configuration.h:368
preferences menu
Definition: ConfigurationServerView.h:14
virtual void activate()
called as soon as the view becomes active
Definition: ConfigurationServerView.h:46
ConfigurationServerView(ConfigurationServerView &&other) noexcept=delete
Move constructor - not available otherwise we get problems with the callbacks.
ConfigurationServerView(LiquidCrystal_PCF8574 *display, RotaryEncoder *encoder, const int &numberOfColumns, const int &numberOfRows)
Construct a new menu object.
Definition: ConfigurationServerView.h:24
ConfigurationServerView(const ConfigurationServerView &other)=delete
Copy constructor - not available.
virtual void tick(const bool &forceRedraw)
Overload Tick.
Definition: ConfigurationServerView.h:70
views::ConfigurationServerView configurationServerView & display
Definition: main.cpp:57
RotaryEncoder encoder(ENCODER_PIN_CLK, ENCODER_PIN_DT, ENCODER_SWITCH)
Definition: ConfigurationServerView.h:10