From b1c83a8491ea50da4fe1bcc6221d9ef82fa69654 Mon Sep 17 00:00:00 2001 From: Jan Almeroth Date: Sun, 24 Sep 2017 02:08:30 +0200 Subject: [PATCH] media_player: Don't switch to first input source, if we actually know better. (#433) * doubleCheck: Don't switch to zero, if we actually know better. https://github.com/home-assistant/home-assistant/issues/9517 * Fix linting * Reverting changes, introducing sourceIndexOld --- src/more-infos/more-info-media_player.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/more-infos/more-info-media_player.html b/src/more-infos/more-info-media_player.html index faaa3257bd..99ee82026b 100644 --- a/src/more-infos/more-info-media_player.html +++ b/src/more-infos/more-info-media_player.html @@ -333,13 +333,14 @@ Polymer({ this.callService('media_next_track'); }, - handleSourceChanged: function (sourceIndex) { + handleSourceChanged: function (sourceIndex, sourceIndexOld) { var sourceInput; // Selected Option will transition to '' before transitioning to new value if (!this.stateObj || this.stateObj.attributes.source_list === undefined || sourceIndex < 0 || sourceIndex >= this.stateObj.attributes.source_list.length + || sourceIndexOld === undefined ) { return; }