Coder Social home page Coder Social logo

Comments (4)

n8henrie avatar n8henrie commented on September 9, 2024 1

I've never heard of mochad, looks like some kind of RF controller? Probably not relevant.

Kind of looks like fauxmo is echoing the whole rest of the line: 'rf a4 on' | nc localhost 1099".

In the future, please try to read through the docstrings before filing an issue:

Note that subprocess.run as implemented in this plugin doesn't handle complex
commands with pipes, redirection, or multiple statements joined by &&, ||,
;, etc., so you can't just use e.g. "command that sometimes fails || true"
to avoid the delay and Alexa's response. If you really want to handle more
complex commands, consider using this plugin as a template for another one
using os.system instead of subprocess.run, but realize that this comes with
substantial security risks that exceed my ability to explain.

My recommendation for an easier fix would be to put the echo 'rf a4 on' | nc localhost 1099 into a shell script, e.g.

#! /bin/bash
# testfile.sh
echo 'rf a4 on' | nc localhost 1099

Make it executable (chmod +x testfile.sh) and test that it works directly (./testfile.sh), and if so then see if you can just call that from commandlineplugin.

from fauxmo-plugins.

pr3sidentspence avatar pr3sidentspence commented on September 9, 2024

Weird, I totally read that paragraph (I remember the end of it), but I must have been half asleep to miss that. I even did 15 minutes of research into whether Shlex was mishandling quotes. Sorry about that.

And, I think what you suggested is exactly what I must have done last time. Thanks!

from fauxmo-plugins.

pr3sidentspence avatar pr3sidentspence commented on September 9, 2024

PS - Is there a place to ask questions or for help with this, or any project, without filing an issue? I'm a github neophyte.

from fauxmo-plugins.

n8henrie avatar n8henrie commented on September 9, 2024

It depends on the organization -- many have a chatroom like Gitter, Slack, or IRC that can work for informal stuff. I can field really quick Qs from Twitter, but otherwise an issue is appropriate.

from fauxmo-plugins.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.