ElektraInitiative / opensesame

3 stars 5 forks source link

nextcloud user status not updated #106

Open markus2330 opened 1 year ago

markus2330 commented 1 year ago

should be battery and open/close etc. but does not seem to be updated properly

fel115 commented 1 year ago

For some reason, the new states aren't updated. Maybe something is wrong with the async fn send_status(&self) function. I get the right status if I check them with the command \status. Maybe there is something wrong with the payload. @horenso do you have any idea?

fel115 commented 1 year ago

Now it's working for me. But I don't know what I have changed, I just added an eprintln for debugging.

fel115 commented 1 year ago

Okay now I tested it with Env and Garage. It worked and I also have an implementation for the Battery status. I think the problem was, that a switch from Closed to Open or from Open to Closed needs to be executed to change the state. Or an update from Environment.

markus2330 commented 1 year ago

Is this fixed in #112?

markus2330 commented 1 year ago

106 doesn't seem to fix the whole problem. Also env status doesn't seem to be set? And I still don't see any battery status.

fel115 commented 1 year ago

I used the .deb file from PR #112 and it updates the status for Env, Bat and Garage.

markus2330 commented 1 year ago

I found in the log would might be the problem here:

Okt 19 11:27:48 garage opensesame[13645]: Error: reqwest::Error { kind: Status(503), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("nextcloud.markus-raab.org")), port: None, path: "/nextcloud/ocs/v2.php/apps/spreed/>
Okt 19 11:27:48 garage opensesame[13645]: Error: reqwest::Error { kind: Status(503), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("nextcloud.markus-raab.org")), port: None, path: "/nextcloud/ocs/v2.php/apps/spreed/>
Okt 19 11:27:48 garage opensesame[13645]: Error: reqwest::Error { kind: Status(503), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("nextcloud.markus-raab.org")), port: None, path: "/nextcloud/ocs/v2.php/apps/spreed/>
Okt 19 11:27:49 garage opensesame[13645]: Error: reqwest::Error { kind: Status(503), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("nextcloud.markus-raab.org")), port: None, path: "/nextcloud/ocs/v2.php/apps/spreed/>
Okt 19 11:27:49 garage opensesame[13645]: Error: reqwest::Error { kind: Status(503), url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("nextcloud.markus-raab.org")), port: None, path: "/nextcloud/ocs/v2.php/apps/spreed/>

Config is nextcloud.url = "https://nextcloud.markus-raab.org/nextcloud which works for sending/receiving messages?

fel115 commented 1 year ago

This is my config of nextcloud and the status update works for me.

nextcloud.user = "<user>"
nextcloud.pass = "<password>"
nextcloud.url = "https://nextcloud.markus-raab.org/nextcloud"
nextcloud.format.datetime = "%d.%m.%Y %H:%M:%S"
nextcloud.format.time = "%H:%M:%S"

I tested it again with the new .deb from master and it still works for me.

As I see the log is created by sending messages because the path nextcloud/ocs/v2.php/apps/spreed/api/v1/chat/ is used to send messages, and the path nextcloud/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom is for updating the status

markus2330 commented 1 year ago

Ok, thx, then these messages are unrelated.