瀏覽代碼

Bug with wrong channel was fixed

Denis V. Dedkov 1 年之前
父節點
當前提交
15b7e2aba5
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Dockerfile
  2. 1 1
      main.cpp

+ 1 - 1
Dockerfile

@@ -14,4 +14,4 @@ run apk add --no-cache libstdc++ libusb
 
 COPY --from=builder /build/noolite-srv /bin/noolite-srv
 
-CMD ["/bin/noolite-srv", "0.0.0.0", "8080"]
+CMD ["/bin/noolite-srv"]

+ 1 - 1
main.cpp

@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
         auto channel = req.path_params.at("channel");
 
         noolitelib::Noolite adapter;
-        if (adapter.sendCommand(0, noolitelib::Switch)) {
+        if (adapter.sendCommand(std::stoi(channel), noolitelib::Switch)) {
             res.set_content(formatResult(true, command + " " + channel), App::ContentType);
         } else {
             res.set_content(formatResult(false, "Device error"), App::ContentType);