From 7954ae49b96796770e8150d09fbd735376581b9a Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Sat, 27 Jun 2020 10:26:54 +0200 Subject: [PATCH] Volume_Cont Added --- app/models/GoogleHome.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/GoogleHome.php b/app/models/GoogleHome.php index 68ad32c..e9f3fde 100644 --- a/app/models/GoogleHome.php +++ b/app/models/GoogleHome.php @@ -100,9 +100,12 @@ class GoogleHome { $tempDevice[$deviceId['id']]['thermostatTemperatureAmbient'] = $lastRecord['value']; $tempDevice[$deviceId['id']]['thermostatTemperatureSetpoint'] = $lastRecord['value']; break; + case 'vol_cont': + $tempDevice[$deviceId['id']]['currentVolume'] = $lastRecord['value']; + break; default: - $tempDevice[$deviceId['id']]['on'] = ($lastRecord['value'] == 1 ? true : false); - break; + $tempDevice[$deviceId['id']]['on'] = ($lastRecord['value'] == 1 ? true : false); + break; } } @@ -310,6 +313,7 @@ static function executeTermostatMode($subDeviceId, $executionCommand){ } static function executeVolume($subDeviceId, $executionCommand){ + echo $executionCommand['params']['volumeLevel']; $status = 'OFFLINE'; $online = false; @@ -326,7 +330,7 @@ static function executeVolume($subDeviceId, $executionCommand){ $waiting++; } } - if ($waiting > $executed){ + if ($waiting < $executed){ $status = "PENDING"; $online = true; $currentVolume = $executionCommand['params']['volumeLevel'];