add support for new SmartLock Generation 3

This commit is contained in:
Marko Oldenburg 2021-11-26 10:13:24 +01:00
parent f1129d5a8f
commit 153caa5715
2 changed files with 32 additions and 18 deletions

View File

@ -2,7 +2,7 @@
# #
# Developed with Kate # Developed with Kate
# #
# (c) 2016-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com) # (c) 2016-2020 Copyright: Marko Oldenburg (hemdevelopment at cooltux dot net)
# All rights reserved # All rights reserved
# #
# This script is free software; you can redistribute it and/or modify # This script is free software; you can redistribute it and/or modify
@ -608,7 +608,8 @@ sub CreateUri($$) {
{ {
$uri .= '&action=' . $lockActionsSmartLock{$param} $uri .= '&action=' . $lockActionsSmartLock{$param}
if ( $endpoint ne 'callback/add' if ( $endpoint ne 'callback/add'
and $deviceType == 0 ); and ($deviceType == 0
|| $deviceType == 4) );
$uri .= '&action=' . $lockActionsOpener{$param} $uri .= '&action=' . $lockActionsOpener{$param}
if ( $endpoint ne 'callback/add' if ( $endpoint ne 'callback/add'
@ -1354,7 +1355,7 @@ sub ParseJSON($$) {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v1.9.16", "version": "v1.9.20",
"x_apiversion": "1.9", "x_apiversion": "1.9",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"

View File

@ -2,7 +2,7 @@
# #
# Developed with Kate # Developed with Kate
# #
# (c) 2016-2020 Copyright: Marko Oldenburg (leongaultier at gmail dot com) # (c) 2016-2021 Copyright: Marko Oldenburg (hemdevelopment at cooltux dot net)
# All rights reserved # All rights reserved
# #
# This script is free software; you can redistribute it and/or modify # This script is free software; you can redistribute it and/or modify
@ -148,7 +148,8 @@ GP_Export(
my %deviceTypes = ( my %deviceTypes = (
0 => 'smartlock', 0 => 'smartlock',
2 => 'opener' 2 => 'opener',
4 => 'smartlockNG'
); );
my %modes = ( my %modes = (
@ -165,47 +166,58 @@ my %modes = (
my %lockStates = ( my %lockStates = (
0 => { 0 => {
0 => 'uncalibrated', 0 => 'uncalibrated',
2 => 'untrained' 2 => 'untrained',
4 => 'uncalibrated'
}, },
1 => { 1 => {
0 => 'locked', 0 => 'locked',
2 => 'online' 2 => 'online',
4 => 'locked'
}, },
2 => { 2 => {
0 => 'unlocking', 0 => 'unlocking',
2 => '-' 2 => '-',
4 => 'unlocking'
}, },
3 => { 3 => {
0 => 'unlocked', 0 => 'unlocked',
2 => 'rto active' 2 => 'rto active',
4 => 'unlocked'
}, },
4 => { 4 => {
0 => 'locking', 0 => 'locking',
2 => '-' 2 => '-',
4 => 'locking'
}, },
5 => { 5 => {
0 => 'unlatched', 0 => 'unlatched',
2 => 'open' 2 => 'open',
4 => 'unlatched'
}, },
6 => { 6 => {
0 => 'unlocked (lock n go)', 0 => 'unlocked (lock n go)',
2 => '-' 2 => '-',
4 => 'unlocked (lock n go)'
}, },
7 => { 7 => {
0 => 'unlatching', 0 => 'unlatching',
2 => 'opening' 2 => 'opening',
4 => 'unlatching'
}, },
253 => { 253 => {
0 => '-', 0 => '-',
2 => 'boot run' 2 => 'boot run',
4 => '-'
}, },
254 => { 254 => {
0 => 'motor blocked', 0 => 'motor blocked',
2 => '-' 2 => '-',
4 => 'motor blocked'
}, },
255 => { 255 => {
0 => 'undefined', 0 => 'undefined',
2 => 'undefined' 2 => 'undefined',
4 => 'undefined'
} }
); );
@ -411,7 +423,8 @@ sub Set($$@) {
my $list = ''; my $list = '';
$list = $list =
'statusRequest:noArg unlock:noArg lock:noArg unlatch:noArg locknGo:noArg locknGoWithUnlatch:noArg unpair:noArg' 'statusRequest:noArg unlock:noArg lock:noArg unlatch:noArg locknGo:noArg locknGoWithUnlatch:noArg unpair:noArg'
if ( $hash->{DEVICETYPE} == 0 ); if ( $hash->{DEVICETYPE} == 0
|| $hash->{DEVICETYPE} == 4 );
$list = $list =
'statusRequest:noArg activateRto:noArg deactivateRto:noArg electricStrikeActuation:noArg activateContinuousMode:noArg deactivateContinuousMode:noArg unpair:noArg' 'statusRequest:noArg activateRto:noArg deactivateRto:noArg electricStrikeActuation:noArg activateContinuousMode:noArg deactivateContinuousMode:noArg unpair:noArg'
if ( $hash->{DEVICETYPE} == 2 ); if ( $hash->{DEVICETYPE} == 2 );
@ -744,7 +757,7 @@ sub WriteReadings($$) {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v1.9.11", "version": "v1.9.20",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],