Skip to content

Commit

Permalink
v2.3源码
Browse files Browse the repository at this point in the history
  • Loading branch information
applenana committed Jul 6, 2024
1 parent 4a845d4 commit 6096c9c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Arduino/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ String ha_mqtt_password;

//-=-=-=-=-=-↓系统配置↓-=-=-=-=-=-=-=-=-=
bool debug = false;
String sw_version = "v2.2";
String sw_version = "v2.3";
String bambu_mqtt_user = "bblp";
String bambu_mqtt_id = "ams";
String ha_mqtt_id = "ams";
Expand Down Expand Up @@ -562,6 +562,11 @@ void bambuCallback(char* topic, byte* payload, unsigned int length) {
Pdata["step"] = "1";
Pdata["subStep"] = "1";
ledAll(0,255,0);
delay(500);
statePublish("发送新的温度!");
bambuClient.publish(bambu_topic_publish.c_str(),
("{\"print\": {\"command\": \"gcode_line\",\"sequence_id\": \"1\",\"param\": \"M109 S"+String(filamentTemp)+"\"},\"user_id\": \"1\"}")
.c_str());
}
}

Expand Down Expand Up @@ -747,6 +752,9 @@ void haTimerCallback() {
haClient.publish(("AMS/"+filamentID+"/mcState").c_str(),mc.getState().c_str());
haClient.publish(("AMS/"+filamentID+"/svState").c_str(),sv.getState().c_str());
haClient.publish(("AMS/"+filamentID+"/backTime").c_str(),String(backTime).c_str());
haClient.publish(("AMS/"+filamentID+"/filaLig/rgb").c_str(),((String(ledR)+","+String(ledG)+","+String(ledB))).c_str());
haClient.publish(("AMS/"+filamentID+"/filamentTemp").c_str(),String(filamentTemp).c_str());
haClient.publish(("AMS/"+filamentID+"/filamentType").c_str(),String(filamentType).c_str());

haLastTime = millis();
}
Expand Down

0 comments on commit 6096c9c

Please sign in to comment.