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() {
|
for (device, control) in devices.plugs.iter() {
|
||||||
self.sql.execute(
|
self.sql.execute(
|
||||||
&format!(
|
&format!(
|
||||||
"INSERT INTO devices (device, type)
|
"INSERT INTO devices (device, type, control)
|
||||||
SELECT \"{device}\", \"plug\"
|
SELECT \"{device}\", \"plug\", ?1
|
||||||
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 };
|
||||||
|
|
Loading…
Reference in a new issue