From 8fba7c6fee56aecf1c76e2604fcf6b9b39f8df1e Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Tue, 31 Oct 2017 11:22:36 +0000 Subject: [PATCH] YAMAHA_AVR: fix max volume when using float values in set command "volume" (Forum: #78756) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15362 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- CHANGED | 2 ++ FHEM/71_YAMAHA_AVR.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGED b/CHANGED index 51fde1801..b96e2db94 100644 --- a/CHANGED +++ b/CHANGED @@ -1,5 +1,7 @@ # 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: 71_YAMAHA_AVR: fix max volume when using float values in + set command "volume" - bugfix: 93_DbRep: V5.8.6, don't limit length of attr reading/device if attr contains a list - feature: 70_KODI: added reading jsonResponse which contains the last diff --git a/FHEM/71_YAMAHA_AVR.pm b/FHEM/71_YAMAHA_AVR.pm index 5390c6fe9..4ab90ab07 100755 --- a/FHEM/71_YAMAHA_AVR.pm +++ b/FHEM/71_YAMAHA_AVR.pm @@ -457,9 +457,9 @@ YAMAHA_AVR_Set($@) { my $target_volume; - if($what eq "volume" and defined($a[2]) and $a[2] =~ /^\d{1,3}$/ and $a[2] >= 0 && $a[2] <= 100) + if($what eq "volume" and defined($a[2]) and $a[2] =~ /^\d{1,3}(?:\.\d)?$/ and $a[2] >= 0 && $a[2] <= 100) { - $target_volume = YAMAHA_AVR_volume_rel2abs($a[2]); + $target_volume = YAMAHA_AVR_volume_rel2abs(int($a[2])); } elsif($what eq "volumeDown" and defined(ReadingsVal($name, "volume", undef))) {