Bug with wrong channel was fixed

This commit is contained in:
2024-05-29 16:02:24 +02:00
parent def91e3a61
commit 15b7e2aba5
2 changed files with 2 additions and 2 deletions

View File

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

View File

@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
auto channel = req.path_params.at("channel"); auto channel = req.path_params.at("channel");
noolitelib::Noolite adapter; 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); res.set_content(formatResult(true, command + " " + channel), App::ContentType);
} else { } else {
res.set_content(formatResult(false, "Device error"), App::ContentType); res.set_content(formatResult(false, "Device error"), App::ContentType);