cmroche / OctoPrint-HomeAssistant

Home Assistant plugin for OctoPrint, enabling MQTT discovery of you device and sensors
110 stars 18 forks source link

Multiple Commands not working #83

Closed MTrab closed 2 years ago

MTrab commented 2 years ago

Trying to issue multiple commands in one publish, but nothing happens. Isn't this supported, like the OctoPrint API states?

    action: call-service
    service: mqtt.publish
    service_data:
      topic: octoprint/core_a8/hassControl/commands
      payload: '["G28","G0 Z300"]'
cmroche commented 2 years ago

Trying to issue multiple commands in one publish, but nothing happens. Isn't this supported, like the OctoPrint API states?

    action: call-service
    service: mqtt.publish
    service_data:
      topic: octoprint/core_a8/hassControl/commands
      payload: '["G28","G0 Z300"]'

Checking the code and API, I would expect multiple commands to work just fine. I am not setup to test at the moment, but could you check one thing for me please. Try removing the single quotes around the payload:. I think this should just be a naked array. If that does/doesn't work let me know and I'll look into it soon.

cmroche commented 2 years ago

Ok, I was able to test this, indeed there is a bug. I'll push a fix soon.

cmroche commented 2 years ago

Fixed on version 3.3.3