Compare commits

..

No commits in common. "c107b67a7e23a1257eb140ca97d0861a6c57602c" and "d79d27fc9fee1356586a3f971dbeb6cc5ddb28af" have entirely different histories.

2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ edition = "2021"
[dependencies] [dependencies]
rusqlite = "0.29.0" rusqlite = "0.29.0"
anyhow = { version = "1.0.75", features = ["backtrace"] } anyhow = { version = "1.0.75", features = ["backtrace"] }
reqwest = "0.11.22" reqwest = "0.11.21"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
futures = "0.3.28" futures = "0.3.28"

View file

@ -79,8 +79,8 @@ impl DataBase {
for (device, control) in devices.plugs.iter() { for (device, control) in devices.plugs.iter() {
self.sql.execute( self.sql.execute(
&format!( &format!(
"INSERT INTO devices (device, type, control) "INSERT INTO devices (device, type)
SELECT \"{device}\", \"plug\", ?1 SELECT \"{device}\", \"plug\"
WHERE WHERE
NOT EXISTS ( NOT EXISTS (
SELECT device SELECT device
@ -89,7 +89,7 @@ impl DataBase {
) )
" "
), ),
&[control], [],
)?; )?;
let ctl = if *control { 1 } else { 0 }; let ctl = if *control { 1 } else { 0 };