Fix write into devices DB
This commit is contained in:
parent
e0daec4c67
commit
95c2943c24
1 changed files with 3 additions and 3 deletions
|
@ -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