mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
10_pilight_ctrl: replace POSIX isdigit because it is deprecated
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@9843 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bb3c4c7e2c
commit
b5280a2a14
@ -1,5 +1,5 @@
|
|||||||
##############################################
|
##############################################
|
||||||
# $Id: 10_pilight_ctrl.pm 1.12 2015-09-11 Risiko $
|
# $Id: 10_pilight_ctrl.pm 1.13 2015-11-10 Risiko $
|
||||||
#
|
#
|
||||||
# Usage
|
# Usage
|
||||||
#
|
#
|
||||||
@ -37,6 +37,7 @@
|
|||||||
# V 1.10 2015-08-30 - NEW: support pressure, windavg, winddir, windgust from weather stations and GPIO sensors
|
# V 1.10 2015-08-30 - NEW: support pressure, windavg, winddir, windgust from weather stations and GPIO sensors
|
||||||
# V 1.11 2015-09-06 - FIX: pressure, windavg, winddir, windgust from weather stations without temperature
|
# V 1.11 2015-09-06 - FIX: pressure, windavg, winddir, windgust from weather stations without temperature
|
||||||
# V 1.12 2015-09-11 - FIX: handling ContactAsSwitch befor white list check
|
# V 1.12 2015-09-11 - FIX: handling ContactAsSwitch befor white list check
|
||||||
|
# V 1.13 2015-11-10 - FIX: POSIX isdigit is deprecated replaced by own isDigit
|
||||||
##############################################
|
##############################################
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
@ -68,6 +69,12 @@ my @unitList = ("unit","unitcode","programcode");
|
|||||||
#brands arctech:kaku,... list of <search>:<replace> protocol names
|
#brands arctech:kaku,... list of <search>:<replace> protocol names
|
||||||
#ContactAsSwitch 1234,... list of ids where contact is transformed to switch
|
#ContactAsSwitch 1234,... list of ids where contact is transformed to switch
|
||||||
|
|
||||||
|
sub isDigit($)
|
||||||
|
{
|
||||||
|
my ($d) = @_;
|
||||||
|
return $d =~ /^\d+?$/ ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
sub pilight_ctrl_Initialize($)
|
sub pilight_ctrl_Initialize($)
|
||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
@ -281,7 +288,7 @@ sub pilight_ctrl_Check($)
|
|||||||
|
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
|
|
||||||
$hash->{helper}{CHECK} = 0 if (!isdigit($hash->{helper}{CHECK}));
|
$hash->{helper}{CHECK} = 0 if (!isDigit($hash->{helper}{CHECK}));
|
||||||
$hash->{helper}{CHECK} +=1;
|
$hash->{helper}{CHECK} +=1;
|
||||||
Log3 $me, 5, "$me(Check): $hash->{STATE}";
|
Log3 $me, 5, "$me(Check): $hash->{STATE}";
|
||||||
|
|
||||||
@ -392,8 +399,8 @@ sub pilight_ctrl_Write($@)
|
|||||||
my $id = $defs{$cName}->{ID};
|
my $id = $defs{$cName}->{ID};
|
||||||
my $unit = $defs{$cName}->{UNIT};
|
my $unit = $defs{$cName}->{UNIT};
|
||||||
|
|
||||||
$id = "\"".$id."\"" if (defined($id) && !isdigit($id));
|
$id = "\"".$id."\"" if (defined($id) && !isDigit($id));
|
||||||
$unit = "\"".$unit."\"" if (defined($unit) && !isdigit($unit));
|
$unit = "\"".$unit."\"" if (defined($unit) && !isDigit($unit));
|
||||||
|
|
||||||
my $code;
|
my $code;
|
||||||
switch($cType){
|
switch($cType){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user