From 4d9318419725cf9d318848f46c4b2883cd6a63ec Mon Sep 17 00:00:00 2001 From: Felix <0xFelix@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:17:12 +0200 Subject: [PATCH] Strip attributes whitespace in universal media_player (#54451) When using whitespace in attributes the lookup of the state attribute fails because an entity with whitespace in its name cannot be found. Works: entity_id|state_attribute Does not work: entity_id | state_attribute Fixes #53804 --- homeassistant/components/universal/media_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/universal/media_player.py b/homeassistant/components/universal/media_player.py index 0ebd9eaf890..2e3e6892c1c 100644 --- a/homeassistant/components/universal/media_player.py +++ b/homeassistant/components/universal/media_player.py @@ -158,7 +158,7 @@ class UniversalMediaPlayer(MediaPlayerEntity): self._cmds = commands self._attrs = {} for key, val in attributes.items(): - attr = val.split("|", 1) + attr = list(map(str.strip, val.split("|", 1))) if len(attr) == 1: attr.append(None) self._attrs[key] = attr