2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

20_FRM_IN.pm: fix undefined value warning when not initialized

git-svn-id: https://svn.fhem.de/fhem/trunk@18939 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jensb 2019-03-17 10:22:23 +00:00
parent 9d95218c79
commit f3e3488f36
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 20_FRM_IN: fix undefined value warning when not initialized
- changed: 74_Unifi: removed UCv3 support
- feature: 59_Weather: and APIs fix utf8 encode bug, insert patch from lippie
- change: 98_Text2Speech.pm: removed some bugs, thanks to RomanticBoy83

View File

@ -127,7 +127,10 @@ FRM_IN_observer($$$$)
{
my ($pin,$last,$new,$hash) = @_;
my $name = $hash->{NAME};
my $old = ReadingsVal($name, "reading", undef) eq "on" ? PIN_HIGH : PIN_LOW;
my $old = ReadingsVal($name, "reading", undef);
if (defined($old)) {
$old = $old eq "on" ? PIN_HIGH : PIN_LOW;
}
if (AttrVal($hash->{NAME},"activeLow","no") eq "yes") {
$new = $new == PIN_LOW ? PIN_HIGH : PIN_LOW;
}
@ -308,6 +311,9 @@ FRM_IN_Attr($$$$) {
CHANGES
15.02.2019 jensb
o bugfix: change detection no longer assumes that reading "reading" is defined
04.11.2018 jensb
o bugfix: get alarm/reading/state
o feature: remove unused FHEMWEB input field from all get commands