This commit is contained in:
parent
7077cf55fe
commit
7686d0af88
1 changed files with 15 additions and 12 deletions
|
@ -131,6 +131,8 @@ func lockCodeEditHandler(c echo.Context) error {
|
||||||
return fmt.Errorf("error pushing enabled state to lock %s (ZWaveDeviceID=%d ID=%d): %v", lock.Name, lock.ZwaveDeviceID, lock.ID, err)
|
return fmt.Errorf("error pushing enabled state to lock %s (ZWaveDeviceID=%d ID=%d): %v", lock.Name, lock.ZwaveDeviceID, lock.ID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newCode := "0000"
|
||||||
|
if enabled {
|
||||||
newCode := c.FormValue("code")
|
newCode := c.FormValue("code")
|
||||||
err = zwaveClient.SetNodeValue(ctx, int(lock.ZwaveDeviceID), zwavejs.NodeValue{
|
err = zwaveClient.SetNodeValue(ctx, int(lock.ZwaveDeviceID), zwavejs.NodeValue{
|
||||||
CCVersion: 1,
|
CCVersion: 1,
|
||||||
|
@ -144,6 +146,7 @@ func lockCodeEditHandler(c echo.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error pushing code to lock %s (ZWaveDeviceID=%d ID=%d): %v", lock.Name, lock.ZwaveDeviceID, lock.ID, err)
|
return fmt.Errorf("error pushing code to lock %s (ZWaveDeviceID=%d ID=%d): %v", lock.Name, lock.ZwaveDeviceID, lock.ID, err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
err = queries.UpdateCodeSlot(ctx, db.UpdateCodeSlotParams{
|
err = queries.UpdateCodeSlot(ctx, db.UpdateCodeSlotParams{
|
||||||
Lock: lockID,
|
Lock: lockID,
|
||||||
|
|
Loading…
Reference in a new issue