mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
Merge branch 'dev'
git-svn-id: https://svn.fhem.de/fhem/trunk@4078 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d222bc7738
commit
4f1d60b411
@ -402,6 +402,19 @@ sub
|
||||
FRM_Client_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
my $pin = $hash->{PIN};
|
||||
eval {
|
||||
my $firmata = FRM_Client_FirmataDevice($hash);
|
||||
$firmata->pin_mode($pin,PIN_ANALOG);
|
||||
};
|
||||
if ($@) {
|
||||
eval {
|
||||
my $firmata = FRM_Client_FirmataDevice($hash);
|
||||
$firmata->pin_mode($pin,PIN_INPUT);
|
||||
$firmata->digital_write($pin,0);
|
||||
};
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub
|
||||
|
@ -23,7 +23,6 @@ FRM_AD_Initialize($)
|
||||
$hash->{GetFn} = "FRM_AD_Get";
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_AD_Init";
|
||||
$hash->{UndefFn} = "FRM_AD_Undef";
|
||||
|
||||
$hash->{AttrList} = "IODev upper-threshold lower-threshold loglevel:0,1,2,3,4,5,6 $main::readingFnAttributes";
|
||||
}
|
||||
@ -100,12 +99,6 @@ FRM_AD_Get($)
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_AD_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -14,7 +14,7 @@ FRM_I2C_Initialize($)
|
||||
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_I2C_Init";
|
||||
$hash->{UndefFn} = "FRM_I2C_Undef";
|
||||
$hash->{UndefFn} = "FRM_Client_Undef";
|
||||
$hash->{AttrFn} = "FRM_I2C_Attr";
|
||||
|
||||
$hash->{AttrList} = "IODev loglevel:0,1,2,3,4,5 $main::readingFnAttributes";
|
||||
@ -50,12 +50,6 @@ sub FRM_I2C_Attr(@) {
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_I2C_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -30,7 +30,7 @@ FRM_IN_Initialize($)
|
||||
$hash->{AttrFn} = "FRM_IN_Attr";
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_IN_Init";
|
||||
$hash->{UndefFn} = "FRM_IN_Undef";
|
||||
$hash->{UndefFn} = "FRM_Client_Undef";
|
||||
|
||||
$hash->{AttrList} = "IODev count-mode:none,rising,falling,both count-threshold reset-on-threshold-reached:yes,no internal-pullup:on,off loglevel:0,1,2,3,4,5 $main::readingFnAttributes";
|
||||
}
|
||||
@ -42,13 +42,12 @@ FRM_IN_Init($$)
|
||||
my $ret = FRM_Init_Pin_Client($hash,$args,PIN_INPUT);
|
||||
return $ret if (defined $ret);
|
||||
eval {
|
||||
my $firmata = FRM_Client_FirmataDevice($hash);
|
||||
$firmata->observe_digital($hash->{PIN},\&FRM_IN_observer,$hash);
|
||||
if (defined (my $pullup = AttrVal($hash->{NAME},"internal-pullup",undef))) {
|
||||
$firmata->digital_write($hash->{PIN},$pullup eq "on" ? 1 : 0);
|
||||
}
|
||||
my $firmata = FRM_Client_FirmataDevice($hash);
|
||||
$firmata->observe_digital($hash->{PIN},\&FRM_IN_observer,$hash);
|
||||
if (defined (my $pullup = AttrVal($hash->{NAME},"internal-pullup",undef))) {
|
||||
$firmata->digital_write($hash->{PIN},$pullup eq "on" ? 1 : 0);
|
||||
}
|
||||
};
|
||||
return $@ if (defined $@);
|
||||
if (! (defined AttrVal($hash->{NAME},"stateFormat",undef))) {
|
||||
$main::attr{$hash->{NAME}}{"stateFormat"} = "reading";
|
||||
}
|
||||
@ -192,12 +191,6 @@ FRM_IN_Attr($$$$) {
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_IN_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -28,7 +28,6 @@ FRM_LCD_Initialize($)
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_LCD_Init";
|
||||
$hash->{SetFn} = "FRM_LCD_Set";
|
||||
$hash->{UndefFn} = "FRM_LCD_Undef";
|
||||
$hash->{AttrFn} = "FRM_LCD_Attr";
|
||||
$hash->{StateFn} = "FRM_LCD_State";
|
||||
|
||||
@ -207,12 +206,6 @@ STATEHANDLER: {
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_LCD_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -16,7 +16,7 @@ FRM_OUT_Initialize($)
|
||||
$hash->{SetFn} = "FRM_OUT_Set";
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_OUT_Init";
|
||||
$hash->{UndefFn} = "FRM_OUT_Undef";
|
||||
$hash->{UndefFn} = "FRM_Client_Undef";
|
||||
$hash->{StateFn} = "FRM_OUT_State";
|
||||
|
||||
$hash->{AttrList} = "restoreOnReconnect:on,off restoreOnStartup:on,off IODev loglevel:0,1,2,3,4,5 $main::readingFnAttributes";
|
||||
@ -74,12 +74,6 @@ STATEHANDLER: {
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_OUT_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -20,7 +20,7 @@ FRM_PWM_Initialize($)
|
||||
$hash->{SetFn} = "FRM_PWM_Set";
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_PWM_Init";
|
||||
$hash->{UndefFn} = "FRM_PWM_Undef";
|
||||
$hash->{UndefFn} = "FRM_Client_Undef";
|
||||
$hash->{StateFn} = "FRM_PWM_State";
|
||||
|
||||
$hash->{AttrList} = "restoreOnReconnect:on,off restoreOnStartup:on,off IODev loglevel:0,1,2,3,4,5 $main::readingFnAttributes";
|
||||
@ -77,12 +77,6 @@ STATEHANDLER: {
|
||||
}
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_PWM_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
@ -20,7 +20,7 @@ FRM_SERVO_Initialize($)
|
||||
$hash->{SetFn} = "FRM_SERVO_Set";
|
||||
$hash->{DefFn} = "FRM_Client_Define";
|
||||
$hash->{InitFn} = "FRM_SERVO_Init";
|
||||
$hash->{UndefFn} = "FRM_SERVO_Undef";
|
||||
$hash->{UndefFn} = "FRM_Client_Undef";
|
||||
$hash->{AttrFn} = "FRM_SERVO_Attr";
|
||||
|
||||
$hash->{AttrList} = "min-pulse max-pulse IODev loglevel:0,1,2,3,4,5 $main::readingFnAttributes";
|
||||
@ -76,12 +76,6 @@ FRM_SERVO_Set($@)
|
||||
return $@;
|
||||
}
|
||||
|
||||
sub
|
||||
FRM_SERVO_Undef($$)
|
||||
{
|
||||
my ($hash, $name) = @_;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
Loading…
x
Reference in New Issue
Block a user