test_kprofile_ack_state_g7.py 1.0 KB

123456789101112131415161718192021222324
  1. """A K-profile command's answer carries no printer status.
  2. The printer echoes extrusion_cali_set / _del / _sel with the nozzle diameter
  3. the command named. Only the extrusion_cali_get answer was kept out of the
  4. status update (#2663), so the others could overwrite the installed nozzle's
  5. diameter with whatever size the profile was written for.
  6. """
  7. import pytest
  8. from backend.app.services.bambu_mqtt import BambuMQTTClient
  9. @pytest.mark.parametrize("command", ["extrusion_cali_set", "extrusion_cali_del", "extrusion_cali_sel"])
  10. def test_the_answer_leaves_the_nozzle_alone(command):
  11. client = BambuMQTTClient(ip_address="10.0.0.9", serial_number="SN-G7", access_code="x", model="X1C")
  12. client._process_message({"print": {"command": "push_status", "nozzle_diameter": "0.4"}})
  13. assert client.state.nozzles[0].nozzle_diameter == "0.4"
  14. client._process_message(
  15. {"print": {"command": command, "sequence_id": "9", "result": "success", "nozzle_diameter": "0.8"}}
  16. )
  17. assert client.state.nozzles[0].nozzle_diameter == "0.4"