Comments (4)
I've never heard of mochad, looks like some kind of RF controller? Probably not relevant.
Kind of looks like fauxmo is echo
ing 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
usingos.system
instead ofsubprocess.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.
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.
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.
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)
- Include now required path in sample config in comments for built in plugins HOT 1
- commandlineplugin sample json file not found HOT 1
- Home Assistant Python bindings deprecated HOT 2
- small typo to be corrected HOT 1
- mqqt library missing HOT 3
- unable to use get_state 'unknown' return with success. HOT 5
- MQTTPlugin: "device doesn't support that" error HOT 4
- GetBinaryState fails if state is not in {`on`, `off`} which prevents adding new devices with unknown state HOT 29
- The fauxmo on|off|unknown statuses should probably be enums, not strings
- The mqtt loop should probably always be running HOT 1
- Add `get_state` methods for the new GetBinaryState command
- 'MQTTPlugin' object has no attribute '_latest_action' HOT 5
- Unable to do discovery HOT 2
- MQTT plugin HOT 12
- commandlineplugin example is missing a comma in the plugin. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fauxmo-plugins.