Compare commits
3 commits
d79d27fc9f
...
c107b67a7e
Author | SHA1 | Date | |
---|---|---|---|
c107b67a7e | |||
411d06f08a | |||
95c2943c24 |
2 changed files with 4 additions and 4 deletions
|
@ -8,7 +8,7 @@ edition = "2021"
|
|||
[dependencies]
|
||||
rusqlite = "0.29.0"
|
||||
anyhow = { version = "1.0.75", features = ["backtrace"] }
|
||||
reqwest = "0.11.21"
|
||||
reqwest = "0.11.22"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
futures = "0.3.28"
|
||||
|
|
|
@ -79,8 +79,8 @@ impl DataBase {
|
|||
for (device, control) in devices.plugs.iter() {
|
||||
self.sql.execute(
|
||||
&format!(
|
||||
"INSERT INTO devices (device, type)
|
||||
SELECT \"{device}\", \"plug\"
|
||||
"INSERT INTO devices (device, type, control)
|
||||
SELECT \"{device}\", \"plug\", ?1
|
||||
WHERE
|
||||
NOT EXISTS (
|
||||
SELECT device
|
||||
|
@ -89,7 +89,7 @@ impl DataBase {
|
|||
)
|
||||
"
|
||||
),
|
||||
[],
|
||||
&[control],
|
||||
)?;
|
||||
|
||||
let ctl = if *control { 1 } else { 0 };
|
||||
|
|
Loading…
Reference in a new issue