mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
74_Unifi: update VC-readings immediately when getting voucher
git-svn-id: https://svn.fhem.de/fhem/trunk@16622 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
494529bf25
commit
466043763d
File diff suppressed because it is too large
Load Diff
@ -18,6 +18,8 @@
|
||||
# - feature: 74_Unifi: added voucher-functions
|
||||
# V 2.2
|
||||
# - feature: 74_Unifi: added set updateClien, encrypt user and password
|
||||
# V 2.2.1
|
||||
# - feature: 74_Unifi: update VC-readings immediately when getting voucher
|
||||
|
||||
|
||||
package main;
|
||||
@ -606,14 +608,15 @@ sub Unifi_Get($@) {
|
||||
elsif ($getName eq 'voucher' && defined $hash->{hotspot}->{vouchers}[0]) {
|
||||
my $returnedVoucher = Unifi_getNextVoucherForNote($hash,$getVal);
|
||||
if ($returnedVoucher eq ""){
|
||||
return "VoucherCache for $getVal is not defined!";
|
||||
return "No voucher with note: $getVal!";
|
||||
}
|
||||
my $returnedVoucherCode = "";
|
||||
if(defined $returnedVoucher->{_id}){
|
||||
$returnedVoucherCode = $returnedVoucher->{code};
|
||||
#if (defined $hash->{hotspot}->{voucherCache}->{$getVal}->{setCmd}){
|
||||
$hash->{hotspot}->{voucherCache}->{$getVal}->{$returnedVoucher->{_id}}->{delivered_at} = time();
|
||||
#}
|
||||
if (defined $hash->{hotspot}->{voucherCache}->{$getVal}->{setCmd}){
|
||||
$hash->{hotspot}->{voucherCache}->{$getVal}->{$returnedVoucher->{_id}}->{delivered_at} = time();
|
||||
readingsSingleUpdate($hash,"-VC_".$getVal,Unifi_getNextVoucherForNote($hash,$getVal)->{code},1);
|
||||
}
|
||||
}
|
||||
return $returnedVoucherCode;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user