MQTT brightness device using Alexa Echo Dot

In contrast to my previous posting this code announces an IoT device supporting a brightness slider, basically a lamp using Espalexa.

#include <PubSubClient.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <WiFiClientSecure.h>
#include <WiFiServer.h>
#include <WiFiUdp.h>
#include <Espalexa.h>
#include "ESP8266HTTPClient.h"
#include "ESP8266httpUpdate.h"

const char* FIRMWARE_VERSION = "1.0";
const char* ssid     = "_REMOVED_";
const char* password = "_REMOVED_";
const char* mqtt_server = "mqtt";

bool currentState = false;
char clientRSSI[50];
void mqttCallback(char* topic, byte* payload, unsigned int length);

Espalexa espalexa;
WiFiClient espClient;
PubSubClient client(mqtt_server, 1883, mqttCallback, espClient);

void mqttCallback(char* topic, byte* payload, unsigned int length) {
}

//our callback functions
void firstLightChanged(uint8_t brightness) {
    if (brightness) {
      client.publish("sensors/hue", "brightness");
    }
    else  {
      client.publish("sensors/hue", "OFF");
    }
}

void setup() {
  WiFi.mode(WIFI_STA);
  if(WiFi.status() != WL_CONNECTED) {
    reconnectWifi();
  }
 
  if (!client.connected()) {
    reconnectMQTT();
  }
  
  espalexa.addDevice("Superlicht", firstLightChanged);
    
  espalexa.begin();
}

void loop() {

  WiFi.mode(WIFI_STA);
  if(WiFi.status() != WL_CONNECTED)
    reconnectWifi();
 
  if (!client.connected())
    reconnectMQTT();
  
  espalexa.loop();
  client.loop();
  delay(0);
}

void reconnectWifi() {
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password); 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
  
  String str = String(WiFi.RSSI());
  str.toCharArray(clientRSSI, str.length()+1);
}

void reconnectMQTT() {  
  while (!client.connected()) {   
    if (client.connect("wemo","sensors/hue/health", 0, true, "offline")) {
      client.publish("sensors/hue/rssi", clientRSSI);  
      client.publish("sensors/hue", "started");
      client.publish("sensors/hue/health", "online", true);
      client.publish("sensors/hue/version", FIRMWARE_VERSION);
    } else
      delay(1000);
  }
}