2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

70_BOTVAC.pm: fixed channel presets

git-svn-id: https://svn.fhem.de/fhem/trunk@19151 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vuffiraa 2019-04-09 19:52:54 +00:00
parent 7236c23316
commit 6ba48baf81
2 changed files with 15 additions and 6 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: 70_BRAVIA: fix channel presets
- bugfix: 49_SSCam: fix perl warnings, Forum: 45671.msg927912.html#msg927912
- new: 10_WS980: new module to control the WS980Wifi weather station
- feature: 93_DbRep: the "explain" SQL-command is possible now in sqlCmd

View File

@ -564,8 +564,8 @@ sub Set($@) {
return "No 2nd argument given" if ( !defined( $a[2] ) );
shift(@a); shift(@a);
my $inputStr = join("#", @a);
shift(@a); shift(@a);
my $inputStr = join("#", @a);
Log3($name, 2, "BRAVIA set $name input $inputStr");
# Resolve input uri
@ -1362,6 +1362,7 @@ sub ProcessCommandData ($$$) {
my %contentKeys;
my $channelName = "-";
my $channelNo = "-";
my $channelUri;
my $currentTitle = "-";
my $currentMedia = "-";
foreach ( keys %{ $hash->{READINGS} } ) {
@ -1424,6 +1425,7 @@ sub ProcessCommandData ($$$) {
}
}
if ($uri) {
$channelUri = $uri;
readingsBulkUpdateIfChanged($hash, "uri", $uri);
foreach ( keys %{$hash->{helper}{device}{inputPreset}} ) {
if ($hash->{helper}{device}{inputPreset}{$_}{uri} eq $uri) {
@ -1467,11 +1469,12 @@ sub ProcessCommandData ($$$) {
readingsEndUpdate( $hash, 1 );
if ($channelName ne "-" && $channelNo ne "-") {
push(@$successor, ["getContentList", ReadingsVal($name, "input", "")])
if (ReadingsVal($name, "requestFormat", "") eq "json"
&& (!defined($hash->{helper}{device}{channelPreset}) || ReadingsVal($name, "state", "") ne "on"));
# push(@$successor, ["getContentList", ReadingsVal($name, "input", "")])
# if (ReadingsVal($name, "requestFormat", "") eq "json"
# && (!defined($hash->{helper}{device}{channelPreset}) || ReadingsVal($name, "state", "") ne "on"));
$hash->{helper}{device}{channelPreset}{ $channelNo }{id} = $channelNo;
$hash->{helper}{device}{channelPreset}{ $channelNo }{name} = GetNormalizedName($channelName);
$hash->{helper}{device}{channelPreset}{ $channelNo }{uri} = $channelUri;
}
# get current system settings
@ -1572,7 +1575,11 @@ sub ProcessCommandData ($$$) {
# increment index, because it starts with 0
if (++$channelIndex % InternalVal($name, "CHANNELCOUNT", 50) == 0) {
# try next junk of channels
push(@$successor, ["getContentList", ReadingsVal($name, "input", "")."|".$channelIndex]);
my $source = $cmd;
if ($cmd =~ /^(.*)\|(\d+)$/){
$source = $1;
}
push(@$successor, ["getContentList", $source."|".$channelIndex]);
}
}
@ -1618,6 +1625,7 @@ sub ProcessCommandData ($$$) {
if (defined($source) and $source =~ /tv:dvb(.)/) {
my $dvbName = GetNormalizedName("TV / DVB-".uc($1));
$hash->{helper}{device}{inputPreset}{$dvbName}{uri} = $source;
push(@$successor, ["getContentList", $source]);
}
}
}