2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

unassign FRM-device if pin_mode fails (for unsupported pin_modes)

git-svn-id: https://svn.fhem.de/fhem/trunk@3021 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
ntruchsess 2013-04-02 10:32:18 +00:00
parent 54553765cf
commit ae29e8c997

View File

@ -358,7 +358,11 @@ FRM_Init_Pin_Client($$$) {
eval {
$hash->{IODev}->{FirmataDevice}->pin_mode($pin,$mode);
};
return "error setting Firmata pin_mode for ".$hash->{NAME}.": ".$@ if ($@);
if ($@) {
main::Log(2,"FRM_Init error setting pin_mode: ".$@);
FRM_Client_Unassign($hash);
return "error setting ".$hash->{NAME}." pin_mode for pin ".$pin;
}
return undef;
}
return "no IODev set" unless defined $hash->{IODev};