Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command store/laststate possible? #42

Open
Bigdeath opened this issue Feb 10, 2020 · 6 comments
Open

New command store/laststate possible? #42

Bigdeath opened this issue Feb 10, 2020 · 6 comments

Comments

@Bigdeath
Copy link

Is it possible to make a store and laststate command?
example:
I am making a fill with red and will send a blink at some point. And say a laststate command within the blink command that it automatically returns to the last state in the case just red. You could give the fill example a store that the laststate knows what it has to do.

With the store command you could generate a file or save it at the memory that stores the whole command and calls it with laststate. Each store then overwrites the last store.

I hope you understand what I mean.

Greetings

@Bigdeath
Copy link
Author

Bigdeath commented Apr 5, 2020

No Answer about 1,5 months?

@tom-2015
Copy link
Owner

tom-2015 commented Apr 5, 2020

Sorry, I've been busy with other project did not have time to implement yet.

@Bigdeath
Copy link
Author

Bigdeath commented Apr 6, 2020

ok, no problem. Thanks for the Answer.

@tom-2015
Copy link
Owner

tom-2015 commented Jul 3, 2020

Added these commands (load_state and save_state) and now updated the documentation. Can you check if it is working properly?

@Bigdeath
Copy link
Author

Bigdeath commented Jul 7, 2020

I have now tried to test it with a few scripts. I just don't quite understand how it works. No CSV is created. I think I'm just doing it wrong. Where exactly should it be inserted? At the end? Is only the last status saved in itself or a whole effect?

In my case i would like to save the endles loop from this Script:

<?php
send_to_leds("
thread_start
brightness 2,255
blink 2,FFFFFF,000000,100,10
render 2
rainbow 2
render 2
do
       rotate 2
       render 2
       delay 1000
loop
brightness 2,255
fill 2, 000000
render 2
thread_stop
");
function send_to_leds ($data){
   $sock = fsockopen("192.168.178.29", 9997);
   fwrite($sock, $data);
   fclose($sock);
}
$timestamp = time();
$datum = date("d.m.Y - H:i:s", $timestamp);
echo $datum;
$datei = fopen("./triggers.txt", "a+");
$date=date("d.m.Y - H:i:s");
fwrite($datei, $daten."LEDPION: $date\r\n");
fclose($datei);
?>

@tom-2015
Copy link
Owner

tom-2015 commented Jul 7, 2020

It saves the current led state (color and brightness).
So normally you put the

save_state 1, "/dev/shm/test.csv"

At the end to save the current led state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants