Add notifier to break relay loop
This commit is contained in:
parent
83c1f033d5
commit
8785186dfa
12 changed files with 124 additions and 45 deletions
emgauwa-core/src/handlers/v1
|
@ -84,7 +84,7 @@ pub async fn show_for_controller(
|
|||
#[put("/api/v1/controllers/{controller_id}/relays/{relay_num}")]
|
||||
pub async fn update_for_controller(
|
||||
pool: web::Data<Pool<Sqlite>>,
|
||||
app_server: web::Data<Addr<AppState>>,
|
||||
app_state: web::Data<Addr<AppState>>,
|
||||
path: web::Path<(String, i64)>,
|
||||
data: web::Json<RequestUpdateRelay>,
|
||||
) -> Result<HttpResponse, EmgauwaError> {
|
||||
|
@ -140,7 +140,7 @@ pub async fn update_for_controller(
|
|||
|
||||
let return_relay = Relay::from_db_model(&mut pool_conn, relay)?;
|
||||
|
||||
app_server
|
||||
app_state
|
||||
.send(app_state::Action {
|
||||
controller_uid: uid,
|
||||
action: ControllerWsAction::Relays(vec![return_relay.clone()]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue