2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

FRM: Merge branch 'dev'

git-svn-id: https://svn.fhem.de/fhem/trunk@4167 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess 2013-11-06 23:12:41 +00:00
parent 32a3c3762f
commit f584813c77
8 changed files with 37 additions and 11 deletions

View File

@ -1,6 +1,7 @@
##############################################
package main;
use vars qw{%attr %defs};
use strict;
use warnings;
@ -469,8 +470,12 @@ sub
FRM_Client_AssignIOPort($)
{
my $hash = shift;
AssignIoPort($main::defs{$hash->{NAME}});
die "unable to assign IODev to '$hash->{NAME}'" unless defined ($hash->{IODev});
my $name = $hash->{NAME};
if (my $iodev = AttrVal($name,"IODev",undef)) {
$hash->{IODev} = $defs{$iodev};
}
AssignIoPort($hash) unless defined($hash->{IODev});
die "unable to assign IODev to '$name'" unless defined ($hash->{IODev});
$hash->{IODev} = $main::defs{$hash->{IODev}->{SNAME}} if (defined($hash->{IODev}->{SNAME}));
@ -673,7 +678,7 @@ sub FRM_OWX_firmata_to_device
sub FRM_OWX_Verify {
my ($hash,$dev) = @_;
foreach my $found ($hash->{DEVS}) {
foreach my $found (@{$hash->{DEVS}}) {
if ($dev eq $found) {
return 1;
}

View File

@ -168,6 +168,9 @@ sub OWAD_Initialize ($) {
$attlist .= " ".$owg_fixed[$i]."High";
}
$hash->{AttrList} = $attlist;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
#########################################################################################

View File

@ -149,6 +149,9 @@ sub OWCOUNT_Initialize ($) {
$attlist .= " ".$owg_fixed[$i]."Period:hour,minute,second";
}
$hash->{AttrList} = $attlist;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
#########################################################################################
@ -1074,7 +1077,7 @@ sub OWFSCOUNT_GetPage($$) {
# $owg_str =~ /([\d\.]+)/;
# a la truchsess
$owg_str =~ s/[^\d\.]+//g;
$owg_str = 0.0 if(!(defined($owg_str)));
$owg_str = 0.0 if(!defined($owg_str) or $owg_str !~ /^\d+\.?\d*$/);
$owg_str = int($owg_str*100)/100;
$owg_midnight[0] = $owg_str;
@ -1093,7 +1096,7 @@ sub OWFSCOUNT_GetPage($$) {
# $owg_str =~ /([\d\.]+)/;
# a la truchsess
$owg_str =~ s/[^\d\.]+//g;
$owg_str = 0.0 if(!(defined($owg_str)));
$owg_str = 0.0 if(!defined($owg_str) or $owg_str !~ /^\d+\.\d*$/);
$owg_str = int($owg_str*100)/100;
$owg_midnight[1] = $owg_str;
}else {
@ -1222,7 +1225,7 @@ sub OWXCOUNT_GetPage($$) {
# $owg_str =~ /([\d\.]+)/;
# a la truchsess
$owg_str =~ s/[^\d\.]+//g;
$owg_str = 0.0 if(!(defined($owg_str)));
$owg_str = 0.0 if(!defined($owg_str) or $owg_str !~ /^\d+\.\d*$/);
$owg_str = int($owg_str*100)/100;
$owg_midnight[0] = $owg_str;
}elsif( $page == 15) {
@ -1231,7 +1234,7 @@ sub OWXCOUNT_GetPage($$) {
# $owg_str =~ /([\d\.]+)/;
# a la truchsess
$owg_str =~ s/[^\d\.]+//g;
$owg_str = 0.0 if(!(defined($owg_str)));
$owg_str = 0.0 if(!defined($owg_str) or $owg_str !~ /^\d+\.\d*$/);
$owg_str = int($owg_str*100)/100;
$owg_midnight[1] = $owg_str;
}
@ -1439,4 +1442,4 @@ sub OWXCOUNT_SetPage($$$) {
</ul>
=end html
=cut
=cut

View File

@ -91,6 +91,9 @@ sub OWID_Initialize ($) {
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 model loglevel:0,1,2,3,4,5 ".
$readingFnAttributes;
$hash->{AttrList} = $attlist;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
#########################################################################################

View File

@ -121,6 +121,9 @@ sub OWLCD_Initialize ($) {
my $attlist = "IODev do_not_notify:0,1 showtime:0,1 loglevel:0,1,2,3,4,5 ".
"";
$hash->{AttrList} = $attlist;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
#########################################################################################

View File

@ -124,7 +124,10 @@ sub OWMULTI_Initialize ($) {
"tempOffset tempUnit:C,Celsius,F,Fahrenheit,K,Kelvin ".
"VName VUnit VFunction ".
$readingFnAttributes;
}
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
########################################################################################
#

View File

@ -144,6 +144,9 @@ sub OWSWITCH_Initialize ($) {
}
$hash->{AttrList} = $attlist;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
#########################################################################################

View File

@ -129,8 +129,11 @@ sub OWTHERM_Initialize ($) {
"stateAL stateAH ".
"tempOffset tempUnit:C,Celsius,F,Fahrenheit,K,Kelvin ".
"tempConv:onkick,onread tempLow tempHigh ".
$readingFnAttributes;
}
$readingFnAttributes;
#make sure OWX is loaded so OWX_CRC is available if running with OWServer
main::LoadModule("OWX");
}
########################################################################################
#