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]
rusqlite = "0.29.0"
anyhow = { version = "1.0.75", features = ["backtrace"] }
reqwest = "0.11.22"
reqwest = "0.11.21"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
futures = "0.3.28"

View file

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