remove passing mqtt client to function

This commit is contained in:
proddy
2020-07-22 16:10:12 +02:00
parent dbaf6fe4b4
commit 2e6cee3429
2 changed files with 4 additions and 4 deletions

View File

@@ -284,8 +284,9 @@ char * Mqtt::make_topic(char * result, const std::string & topic) {
return result; return result;
} }
void Mqtt::start(AsyncMqttClient * mqttClient) { void Mqtt::start() {
mqttClient_ = mqttClient; // copy over from esp8266-react's MQTT service
mqttClient_ = EMSESP::esp8266React.getMqttClient();
// get the hostname, which we'll use to prefix to all topics // get the hostname, which we'll use to prefix to all topics
EMSESP::esp8266React.getWiFiSettingsService()->read([&](WiFiSettings & wifiSettings) { hostname_ = wifiSettings.hostname.c_str(); }); EMSESP::esp8266React.getWiFiSettingsService()->read([&](WiFiSettings & wifiSettings) { hostname_ = wifiSettings.hostname.c_str(); });

View File

@@ -59,8 +59,7 @@ struct MqttMessage {
class Mqtt { class Mqtt {
public: public:
void loop(); void loop();
void start();
void start(AsyncMqttClient * mqttClient);
void set_publish_time(uint16_t publish_time); void set_publish_time(uint16_t publish_time);
void set_qos(uint8_t mqtt_qos); void set_qos(uint8_t mqtt_qos);