mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 06:36:04 +00:00
70_ESCVP21net.pm: bugfix perl warning
git-svn-id: https://svn.fhem.de/fhem/trunk@25610 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7d013b3210
commit
ea6a8d4986
@ -15,6 +15,7 @@
|
|||||||
# 1.01.02 supporting multiple devices (store set and result in device hash)
|
# 1.01.02 supporting multiple devices (store set and result in device hash)
|
||||||
# adding debug attr
|
# adding debug attr
|
||||||
# 1.01.03 rename to 70_ESCVP21net, clean up and prepare for fhem trunk
|
# 1.01.03 rename to 70_ESCVP21net, clean up and prepare for fhem trunk
|
||||||
|
# 1.01.04 small bug fix, DevIo log messages moved to loglevel 5
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
########################################################################################
|
########################################################################################
|
||||||
@ -845,7 +846,7 @@ sub ESCVP21net_setValueDone {
|
|||||||
( $name, $cmd, $result ) = split( "\\|", $resultarr[$count] );
|
( $name, $cmd, $result ) = split( "\\|", $resultarr[$count] );
|
||||||
if ($result =~ "ERROR"){
|
if ($result =~ "ERROR"){
|
||||||
$getcmds .=$cmd." (error),";
|
$getcmds .=$cmd." (error),";
|
||||||
#$rv = $result;
|
$rv = $result;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$rv = readingsBulkUpdate($hash, $cmd, $result, 1);
|
$rv = readingsBulkUpdate($hash, $cmd, $result, 1);
|
||||||
@ -1005,14 +1006,14 @@ sub ESCVP21net_checkConnection ($) {
|
|||||||
# no internal timer needed
|
# no internal timer needed
|
||||||
delete $hash->{helper}{nextConnectionCheck}
|
delete $hash->{helper}{nextConnectionCheck}
|
||||||
if ( defined( $hash->{helper}{nextConnectionCheck} ) );
|
if ( defined( $hash->{helper}{nextConnectionCheck} ) );
|
||||||
main::Log3 $name, 3, "[$name]: DevIo_Open has no FD, NEXT_OPEN is $hash->{NEXT_OPEN}, no timer set";
|
main::Log3 $name, 5, "[$name]: DevIo_Open has no FD, NEXT_OPEN is $hash->{NEXT_OPEN}, no timer set";
|
||||||
}
|
}
|
||||||
elsif (!($hash->{FD}) && !$hash->{NEXT_OPEN}){
|
elsif (!($hash->{FD}) && !$hash->{NEXT_OPEN}){
|
||||||
# not connected, DevIo not active, so device won't open again automatically
|
# not connected, DevIo not active, so device won't open again automatically
|
||||||
# should never happen, since we called DevIo_Open above!
|
# should never happen, since we called DevIo_Open above!
|
||||||
# no internal timer needed, but should we ask DevIo again for opening the connection?
|
# no internal timer needed, but should we ask DevIo again for opening the connection?
|
||||||
#DevIo_OpenDev($hash, 1, "ESCVP21net_Init", "ESCVP21net_Callback");
|
#DevIo_OpenDev($hash, 1, "ESCVP21net_Init", "ESCVP21net_Callback");
|
||||||
main::Log3 $name, 3, "[$name]: DevIo_Open has no FD, no NEXT_OPEN, should not happen!";
|
main::Log3 $name, 5, "[$name]: DevIo_Open has no FD, no NEXT_OPEN, should not happen!";
|
||||||
}
|
}
|
||||||
elsif ($hash->{FD} && $hash->{NEXT_OPEN}){
|
elsif ($hash->{FD} && $hash->{NEXT_OPEN}){
|
||||||
# not connected - device was connected, but is not reachable currently
|
# not connected - device was connected, but is not reachable currently
|
||||||
@ -1023,7 +1024,7 @@ sub ESCVP21net_checkConnection ($) {
|
|||||||
#DevIo_OpenDev($hash, 1, "ESCVP21net_Init", "ESCVP21net_Callback");
|
#DevIo_OpenDev($hash, 1, "ESCVP21net_Init", "ESCVP21net_Callback");
|
||||||
delete $hash->{helper}{nextConnectionCheck}
|
delete $hash->{helper}{nextConnectionCheck}
|
||||||
if ( defined( $hash->{helper}{nextConnectionCheck} ) );
|
if ( defined( $hash->{helper}{nextConnectionCheck} ) );
|
||||||
main::Log3 $name, 3, "[$name]: DevIo_Open has FD and NEXT_OPEN, try to reconnect periodically";
|
main::Log3 $name, 5, "[$name]: DevIo_Open has FD and NEXT_OPEN, try to reconnect periodically";
|
||||||
}
|
}
|
||||||
elsif ($hash->{FD} && !$hash->{NEXT_OPEN}){
|
elsif ($hash->{FD} && !$hash->{NEXT_OPEN}){
|
||||||
# device is connectd, or seems to be (since broken connection is not detected by DevIo!)
|
# device is connectd, or seems to be (since broken connection is not detected by DevIo!)
|
||||||
@ -1033,7 +1034,7 @@ sub ESCVP21net_checkConnection ($) {
|
|||||||
my $next = gettimeofday() + $checkInterval; # if checkInterval is off, we won't reach this line
|
my $next = gettimeofday() + $checkInterval; # if checkInterval is off, we won't reach this line
|
||||||
$hash->{helper}{nextConnectionCheck} = $next;
|
$hash->{helper}{nextConnectionCheck} = $next;
|
||||||
InternalTimer( $next, "ESCVP21net_checkConnection", $hash);
|
InternalTimer( $next, "ESCVP21net_checkConnection", $hash);
|
||||||
main::Log3 $name, 3, "[$name]: DevIo_Open has FD but no NEXT_OPEN, next timer set";
|
main::Log3 $name, 5, "[$name]: DevIo_Open has FD but no NEXT_OPEN, next timer set";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +1,29 @@
|
|||||||
|
attr global userattr cmdIcon devStateIcon:textField-long devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride
|
||||||
|
attr global autoload_undefined_devices 1
|
||||||
attr global logfile ./log/fhem-%Y-%m.log
|
attr global logfile ./log/fhem-%Y-%m.log
|
||||||
attr global modpath .
|
attr global modpath .
|
||||||
attr global verbose 3
|
|
||||||
attr global statefile ./log/fhem.save
|
attr global statefile ./log/fhem.save
|
||||||
|
attr global verbose 3
|
||||||
|
|
||||||
define WEB FHEMWEB 8083 global
|
define WEB FHEMWEB 8083 global
|
||||||
|
setuuid WEB 61f6c735-f33f-4fb8-9882-c21ddaec2c924d6a
|
||||||
|
attr WEB stylesheetPrefix f11
|
||||||
|
|
||||||
# Fake FileLog entry, to access the fhem log from FHEMWEB
|
# Fake FileLog entry, to access the fhem log from FHEMWEB
|
||||||
define Logfile FileLog ./log/fhem-%Y-%m.log Logfile
|
define Logfile FileLog ./log/fhem-%Y-%m.log Logfile
|
||||||
|
setuuid Logfile 61f6c735-f33f-4fb8-0e86-b03c8252a274fd78
|
||||||
|
|
||||||
define autocreate autocreate
|
define autocreate autocreate
|
||||||
|
setuuid autocreate 61f6c735-f33f-4fb8-f905-8d60f2e4c2e9b9a0
|
||||||
attr autocreate filelog ./log/%NAME-%Y.log
|
attr autocreate filelog ./log/%NAME-%Y.log
|
||||||
|
|
||||||
define eventTypes eventTypes ./log/eventTypes.txt
|
define eventTypes eventTypes ./log/eventTypes.txt
|
||||||
|
setuuid eventTypes 61f6c735-f33f-4fb8-56d4-92b2c9fa10c71b04
|
||||||
|
|
||||||
# Disable this to avoid looking for new USB devices on startup
|
# Disable this to avoid looking for new USB devices on startup
|
||||||
define initialUsbCheck notify global:INITIALIZED usb create
|
define initialUsbCheck notify global:INITIALIZED usb create
|
||||||
|
setuuid initialUsbCheck 61f6c735-f33f-4fb8-6eaf-3b76af76fe97b731
|
||||||
|
define Epson2 ESCVP21net 192.168.81.141 3629 TW5650
|
||||||
|
setuuid Epson2 61f6ed63-f33f-4fb8-73f7-d8986839543a77cf
|
||||||
|
attr Epson2 room Beamer
|
||||||
|
attr Epson2 stateFormat PWR
|
||||||
|
Loading…
x
Reference in New Issue
Block a user