 {
   const uint16_t BARS_BOTTOM      = 190;
   const uint16_t BARS_HEIGHT      = BARS_BOTTOM;
-  const uint16_t BARS_BORDER      = 10;
-  const uint16_t BARS_WIDTH       = 200 / 5; /* note: total width is 200 px */
+  const uint16_t BARS_BORDER      = 12;
+  const uint16_t BARS_WIDTH       = 210 / 5; /* note: total width is 210 px */
   const float    HEIGHT_FACTOR    = BARS_HEIGHT / 100.0;
 
-  button_t TFT_CLOCK_AREA
+  static wl_status_t   currentWiFiStatus;
+  static lightStatus_t currentLightStatus;
+
+  button_t networkArea
+  {
+    140, 205, 170, 30
+  };
+
+  button_t clockArea
   {
     10, 205, 110, 30
   };
 
-  button_t TFT_NETWORK_AREA
-  {
-    140, 205, 170, 30
-  };
-
-  button_t tempArea[numberOfFoundSensors];
-
   uint16_t channelColor565[NUMBER_OF_CHANNELS];
 
   if ( tftClearScreen )
   {
     tft.fillScreen( ILI9341_BLACK );
-    drawButton( MENU_BUTTON, ILI9341_BLUE, 0 );
+    drawButton( MENU_BUTTON, ILI9341_YELLOW, ILI9341_BLUE, 0, 1 );
     tft.setTextColor( ILI9341_YELLOW, ILI9341_BLACK );
-    tft.startWrite();
+
+    showIPAddress( networkArea );
+    currentWiFiStatus = WiFi.status();
+
+    //tft.startWrite();
     for ( uint8_t thisSensor = 0; thisSensor < numberOfFoundSensors; thisSensor++ )
     {
       tempArea[thisSensor].x = 220;
       tempArea[thisSensor].y = 70 + thisSensor * 50;
       tempArea[thisSensor].w = TFT_BUTTON_WIDTH - 20;
       tempArea[thisSensor].h = 30;
-      tft.writeFastHLine( tempArea[thisSensor].x, tempArea[thisSensor].y, tempArea[thisSensor].w, ILI9341_GREEN );
-      tft.writeFastHLine( tempArea[thisSensor].x, tempArea[thisSensor].y + tempArea[thisSensor].h, tempArea[thisSensor].w, ILI9341_GREEN );
-      tft.writeFastVLine( tempArea[thisSensor].x, tempArea[thisSensor].y, tempArea[thisSensor].h, ILI9341_GREEN );
-      tft.writeFastVLine( tempArea[thisSensor].x + tempArea[thisSensor].w, tempArea[thisSensor].y, tempArea[thisSensor].h, ILI9341_GREEN );
-    }
-    tft.endWrite();
+      //tft.writeFastHLine( tempArea[thisSensor].x, tempArea[thisSensor].y, tempArea[thisSensor].w, ILI9341_GREEN );
+      //tft.writeFastHLine( tempArea[thisSensor].x, tempArea[thisSensor].y + tempArea[thisSensor].h, tempArea[thisSensor].w, ILI9341_GREEN );
+      //tft.writeFastVLine( tempArea[thisSensor].x, tempArea[thisSensor].y, tempArea[thisSensor].h, ILI9341_GREEN );
+      //tft.writeFastVLine( tempArea[thisSensor].x + tempArea[thisSensor].w, tempArea[thisSensor].y, tempArea[thisSensor].h, ILI9341_GREEN );
+    }
+    //tft.endWrite();
+
+    /* draw temp sensors */
+    tft.setTextSize( 0 );
     for ( uint8_t thisSensor = 0; thisSensor < numberOfFoundSensors; thisSensor++ )
     {
       int16_t x, y;
       uint16_t w, h;
-      tft.setTextSize( 0 );
       tft.getTextBounds( sensor[thisSensor].name, 0, 0, &x, &y, &w, &h);
       tft.setCursor( ( tempArea[thisSensor].x + tempArea[thisSensor].w / 2 ) - w / 2,
-                     ( tempArea[thisSensor].y - 10 ) );
+                     ( tempArea[thisSensor].y - 6 ) );
       tft.print( sensor[thisSensor].name );
     }
-    tftClearScreen = false;
-  }
+    drawSensors( true );
+  }
+
+  static uint16_t oldPercentage[NUMBER_OF_CHANNELS];
+  static uint16_t oldColor565[NUMBER_OF_CHANNELS];
 
   tft.startWrite();
   for ( uint8_t channelNumber = 0; channelNumber < NUMBER_OF_CHANNELS; channelNumber++ )
   {
-    // redraw the top part of the bar
-    tft.writeFillRect( channelNumber * BARS_WIDTH + BARS_BORDER,
-                       BARS_BOTTOM - BARS_HEIGHT,
-                       BARS_WIDTH - BARS_BORDER * 2,
-                       BARS_HEIGHT - channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
-                       TFT_BACK_COLOR );
-    /*
-          //100% water mark
-          tft.drawFastHLine( channelNumber * BARS_WIDTH + BARS_BORDER,
-                             BARS_BOTTOM - BARS_HEIGHT - 1,
-                             BARS_WIDTH - BARS_BORDER * 2,
-                             tft.color565( r, g, b ) );
-    */
-
     uint32_t color = strtol( &channel[channelNumber].color[1], NULL, 16 );
     channelColor565[channelNumber] = tft.color565( ( color & 0xFF0000 ) >> 16, ( color & 0x00FF00 ) >> 8, color & 0x0000FF  );
 
-    // redraw the bottom part of the bar
-    tft.writeFillRect( channelNumber * BARS_WIDTH + BARS_BORDER,
-                       BARS_BOTTOM - channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
-                       BARS_WIDTH - BARS_BORDER * 2,
-                       channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
-                       channelColor565[channelNumber]);
+    /* only draw channels that changed percentage or color */
+    if ( tftClearScreen || oldPercentage[ channelNumber ] != channel[channelNumber].currentPercentage ||
+         oldColor565[ channelNumber ] != channelColor565[ channelNumber ] )
+    {
+      // redraw the top part of the bar
+      tft.writeFillRect( channelNumber * BARS_WIDTH + BARS_BORDER,
+                         BARS_BOTTOM - BARS_HEIGHT,
+                         BARS_WIDTH - BARS_BORDER * 2,
+                         BARS_HEIGHT - channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
+                         TFT_BACK_COLOR );
+      /*
+            //100% water mark
+            tft.drawFastHLine( channelNumber * BARS_WIDTH + BARS_BORDER,
+                               BARS_BOTTOM - BARS_HEIGHT - 1,
+                               BARS_WIDTH - BARS_BORDER * 2,
+                               tft.color565( r, g, b ) );
+      */
+
+      // redraw the bottom part of the bar
+      tft.writeFillRect( channelNumber * BARS_WIDTH + BARS_BORDER,
+                         BARS_BOTTOM - channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
+                         BARS_WIDTH - BARS_BORDER * 2,
+                         channel[channelNumber].currentPercentage * HEIGHT_FACTOR,
+                         channelColor565[channelNumber]);
+    }
   }
   tft.endWrite();
 


  int16_t x, y;
  uint16_t w, h;
  tft.getTextBounds( button.text, 0, 0, &x, &y, &w, &h);
  tft.setCursor( ( button.x + button.w / 2 ) - w / 2,
                 ( button.y + button.h / 2 ) - h / 2 );
  tft.print( button.text );
}

static inline __attribute__((always_inline)) void drawMenuButtons()
{
  drawButton( LIGHTSON_BUTTON,     lightStatus == LIGHTS_ON  ? ILI9341_RED : ILI9341_BLUE, 0 );
  drawButton( LIGHTSOFF_BUTTON,    lightStatus == LIGHTS_OFF ? ILI9341_RED : ILI9341_BLUE, 0 );
  drawButton( LIGHTSAUTO_BUTTON,   lightStatus == LIGHTS_AUTO ? ILI9341_RED : ILI9341_BLUE, 0 );
  drawButton( EXIT_BUTTON, ILI9341_BLUE, 0 );
}

static inline __attribute__((always_inline)) bool buttonPressed( struct button_t button, const TS_Point p )

  }
}

static inline __attribute__((always_inline)) void drawButton( struct button_t button, uint16_t labelcolor, uint16_t color, uint16_t bordercolor, const uint8_t fontsize )
{
  if ( color || bordercolor )
  {
    tft.startWrite();
