mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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
This commit is contained in:
parent
bc417162cf
commit
4d93184197
@ -158,7 +158,7 @@ class UniversalMediaPlayer(MediaPlayerEntity):
|
|||||||
self._cmds = commands
|
self._cmds = commands
|
||||||
self._attrs = {}
|
self._attrs = {}
|
||||||
for key, val in attributes.items():
|
for key, val in attributes.items():
|
||||||
attr = val.split("|", 1)
|
attr = list(map(str.strip, val.split("|", 1)))
|
||||||
if len(attr) == 1:
|
if len(attr) == 1:
|
||||||
attr.append(None)
|
attr.append(None)
|
||||||
self._attrs[key] = attr
|
self._attrs[key] = attr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user