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

98_GOOGLECAST: fix open connections

git-svn-id: https://svn.fhem.de/fhem/trunk@16250 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dominikkarall 2018-02-23 20:34:49 +00:00
parent 2d5f434972
commit 0cea8ef008
2 changed files with 12 additions and 2 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: 98_GOOGLECAST: fix open connections and state value
- feature: 10_MQTT_DEVICE: add SetExtensions
- bugfix: 00_MQTT: small bugfix
- feature: 98_DOIFtools: support for multiple holiday files in holiday2we for

View File

@ -7,10 +7,14 @@
# FHEM module to communicate with Google Cast devices
# e.g. Chromecast Video, Chromecast Audio, Google Home
#
# Version: 2.0.3
# Version: 2.1.0
#
#############################################################
#
# v2.1.0 - 20180218
# - BUGFIX: one more socket_client fix
# - BUGFIX: offline state fix
#
# v2.0.3 - 20180217
# - CHANGE: increase speak limit to 500 characters
#
@ -138,7 +142,7 @@ sub GOOGLECAST_Initialize($) {
$hash->{AttrList} = "favoriteURL_1 favoriteURL_2 favoriteURL_3 favoriteURL_4 ".
"favoriteURL_5 ".$readingFnAttributes;
Log3 $hash, 3, "GOOGLECAST: GoogleCast v2.0.3";
Log3 $hash, 3, "GOOGLECAST: GoogleCast v2.1.0";
return undef;
}
@ -156,6 +160,7 @@ sub GOOGLECAST_Define($$) {
Log3 $hash, 3, "GOOGLECAST: $a[2] initializing...";
$hash->{CCNAME} = $a[2];
GOOGLECAST_updateReading($hash, "presence", "offline");
GOOGLECAST_updateReading($hash, "state", "offline");
GOOGLECAST_initDevice($hash);
}
@ -562,8 +567,10 @@ sub GOOGLECAST_checkConnection {
if($@ || !defined($selectlist{"GOOGLECAST-".$hash->{NAME}})) {
Log3 $hash, 4, "GOOGLECAST ($hash->{NAME}): checkConnection, connection failure, reconnect...";
delete($selectlist{"GOOGLECAST-".$hash->{NAME}});
$hash->{helper}{ccdevice}->{socket_client}->_cleanup();
GOOGLECAST_initDevice($hash);
GOOGLECAST_updateReading($hash, "presence", "offline");
GOOGLECAST_updateReading($hash, "state", "offline");
return undef;
}
@ -587,8 +594,10 @@ sub GOOGLECAST_Read {
eval {
delete($selectlist{$name});
};
$hash->{helper}{ccdevice}->{socket_client}->_cleanup();
GOOGLECAST_initDevice($hash);
GOOGLECAST_updateReading($hash, "presence", "offline");
GOOGLECAST_updateReading($hash, "state", "offline");
return undef;
}