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

Implementation of SensorChange::Alarm(w) #90

Open
fel115 opened this issue Oct 2, 2023 · 0 comments
Open

Implementation of SensorChange::Alarm(w) #90

fel115 opened this issue Oct 2, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fel115
Copy link
Collaborator

fel115 commented Oct 2, 2023

For now, only a message is sent to Nextcloud. In the future, the state in Elektra should be changed.

...
SensorsChange::Alarm(w) => {
    nextcloud_sender
	.send(NextcloudEvent::Chat(
	    NextcloudChat::Default,
	    gettext!("Fire Alarm {}", w),
	))
	.await?;
	let mut state = state_mutex.lock().await;
	state.set("alarm/fire", &w.to_string());
	kill(nix::unistd::Pid::from_raw(pid as i32), Signal::SIGHUP)?;
	spawn(exec_ssh_command(format!(
		"kdb set user:/state/libelektra/opensesame/#0/current/alarm/fire \"{}\"",
		w
	)));
}
...

With that implementation, we get the following error:

pensesame: Kein Prozess gefunden
thread 'tokio-runtime-worker' panicked at 'Set config failed: Sorry, module  issued error :
: ', src/config.rs:31:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
opensesame: Kein Prozess gefunden

Maybe something in the config Module needs to be changed.

@fel115 fel115 added the enhancement New feature or request label Oct 2, 2023
@fel115 fel115 changed the title Implementation of SensorChange: Implementation of SensorChange::Alarm(w) Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant