Git Product home page Git Product logo

Comments (3)

JnyJny avatar JnyJny commented on July 28, 2024

I haven't used iOS shortcuts, so my guess is the following:

  • the command ends in an amperand & which directs the shell to run a process in the background
  • the iOS "Run script over SSH" probably strips the ampersand from the command (I would)
  • The command will run for 3600 seconds and then return, at which point the iOS action will terminate as you might expect.

When the blynclight package finishes a "session" using the light, by default it turns the light off and zeros all the various color values and feature switches. This is to avoid weird behavior when the light is activated again (flashing, bleeps and bloops that the user didn't initiate).

One way to fix the iOS problem is to allow blync to return and leave the light in it's currently configured state (on, shining red). This will lose the ability to run for an interval and then turn off. I guess you could have another action that turns the light off explicitly? Not sure.

Another way to get the desired behavior (iOS action terminates normally, light stays lit red for 1 hour and then turns off) would be to add a 'daemon' switch that would run the command in the background (without requiring the ampersand). The command would run in the background and turn off after an hour while allow the iOS action complete as expected.

from blynclight.

mcnahum avatar mcnahum commented on July 28, 2024

I tired a lot of options, including a simple "/home/pi/.local/bin/blync -r 255" or even "/home/pi/.local/bin/rainbow" and it's the same... really strange ... I also tried to embed the command in a shell script but it's the same...

"/home/pi/.local/bin/blync -a" is working correctly and give the proper output

So yes a daemon could be a solution, it start and run for 1 hour ( or the parameter I could pass) ... I will have to look this week-end how I can do

from blynclight.

JnyJny avatar JnyJny commented on July 28, 2024

The latest version (0.7.1) has an updated driver script that may do some of what you are looking for; now when the blync tool exits, it DOES NOT clear the state of the light (turning it off and zeroing all the commands issued while the script was running). So maybe now you can get some of the features to work via the iOS Shortcut application:

$ ssh <yourhost> blync  # will turn the light on with a green color and the light stays on.
$ ssh <yourhost> blync --off. # turns the light off

Effects that constantly update the state of the light will continue to disappoint I think; e.g. fli, throbber and rainbow.

Having those sorts of effects persist after a script runs will probably need a client/server architecture that sounds like fun to write, but I don't have plans to do it soon. I hope some of this helps.

Edit:

Created an iOS ssh shortcut that worked. After installing blynclight, had to use the full path to blync in order for it to work: /usr/local/bin/blync in my case.

from blynclight.

Related Issues (20)

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.