Get rid of some unnecessary serial output.
This commit is contained in:
parent
123d70f7f7
commit
59df30351e
@ -129,8 +129,5 @@ void Communicator::mqtt_discovery(const String topic, StaticJsonDocument<1536> &
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Communicator::publish_data(String topic, String value) {
|
void Communicator::publish_data(String topic, String value) {
|
||||||
Serial.print(topic);
|
|
||||||
Serial.print(" --> ");
|
|
||||||
Serial.println(value);
|
|
||||||
_mqtt_client.publish(topic.c_str(), value.c_str(), true);
|
_mqtt_client.publish(topic.c_str(), value.c_str(), true);
|
||||||
}
|
}
|
||||||
|
@ -32,12 +32,11 @@ unsigned long currentMillis;
|
|||||||
|
|
||||||
void mqttCallback(char *topic, byte *payload, unsigned int length) {
|
void mqttCallback(char *topic, byte *payload, unsigned int length) {
|
||||||
payload[length] = '\0';
|
payload[length] = '\0';
|
||||||
|
|
||||||
for (int i=0;i<TOTAL_DEVICES;i++) {
|
for (int i=0;i<TOTAL_DEVICES;i++) {
|
||||||
if (strcmp((char *)topic, (DEVICE_LIST[i].mode.CmdTopic).c_str() ) == 0){
|
if (strcmp((char *)topic, (DEVICE_LIST[i].mode.CmdTopic).c_str() ) == 0){
|
||||||
DEVICE_LIST[i].mode.Setting = (char*)payload;
|
DEVICE_LIST[i].mode.Setting = (char*)payload;
|
||||||
Serial.print("Swing: ");
|
|
||||||
Serial.println(DEVICE_LIST[i].swing_topic);
|
|
||||||
if (DEVICE_LIST[i].mode.Setting == "auto") {
|
if (DEVICE_LIST[i].mode.Setting == "auto") {
|
||||||
DEVICE_LIST[i].swing_state = "off";
|
DEVICE_LIST[i].swing_state = "off";
|
||||||
hass_comm.publish_data(DEVICE_LIST[i].swing_topic, "on");
|
hass_comm.publish_data(DEVICE_LIST[i].swing_topic, "on");
|
||||||
@ -45,11 +44,11 @@ void mqttCallback(char *topic, byte *payload, unsigned int length) {
|
|||||||
DEVICE_LIST[i].swing_state = "on";
|
DEVICE_LIST[i].swing_state = "on";
|
||||||
hass_comm.publish_data(DEVICE_LIST[i].swing_topic, "off");
|
hass_comm.publish_data(DEVICE_LIST[i].swing_topic, "off");
|
||||||
}
|
}
|
||||||
|
|
||||||
hass_comm.publish_data(DEVICE_LIST[i].mode.StateTopic, DEVICE_LIST[i].mode.Setting);
|
hass_comm.publish_data(DEVICE_LIST[i].mode.StateTopic, DEVICE_LIST[i].mode.Setting);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int setpoint_count;
|
int setpoint_count;
|
||||||
bool dual_mode = DEVICE_LIST[i].dual;
|
bool dual_mode = DEVICE_LIST[i].dual;
|
||||||
if (dual_mode) {
|
if (dual_mode) {
|
||||||
@ -191,7 +190,7 @@ void setup() {
|
|||||||
const char* password = WIFI_PASSWORD;
|
const char* password = WIFI_PASSWORD;
|
||||||
sensors.begin();
|
sensors.begin();
|
||||||
sensors.setResolution(glycol_ds18b20, 9);
|
sensors.setResolution(glycol_ds18b20, 9);
|
||||||
|
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user