5959_BOOL = BooleanSelector ()
6060_MULTILINE = TextSelector (TextSelectorConfig (multiline = True ))
6161_PERSON_MULTI = EntitySelector (EntitySelectorConfig (domain = "person" , multiple = True ))
62- _MEDIA_PLAYER = EntitySelector (EntitySelectorConfig (domain = "media_player" , multiple = False ))
62+ _MEDIA_PLAYER = EntitySelector (EntitySelectorConfig (domain = "media_player" , multiple = True ))
6363
6464
6565def _is_valid_time (value : str ) -> bool :
@@ -243,7 +243,7 @@ async def async_step_add_first_channel(self, user_input=None):
243243 "target" : (user_input .get ("target" ) or "" ).strip (),
244244 "is_voice" : user_input .get ("is_voice" , False ),
245245 "alt_services" : alt_services ,
246- "default_media_player" : ( user_input .get ("default_media_player" ) or "" ). strip () ,
246+ "default_media_player" : user_input .get ("default_media_player" , [ "" ])[ 0 ] if user_input . get ( "default_media_player" ) else "" ,
247247 }
248248 }
249249 await self .async_set_unique_id (DOMAIN )
@@ -256,7 +256,7 @@ async def async_step_add_first_channel(self, user_input=None):
256256 vol .Optional ("target" , default = "" ): _TEXT ,
257257 vol .Optional ("is_voice" , default = False ): _BOOL ,
258258 vol .Optional ("alt_services" , default = "{}" ): _MULTILINE ,
259- vol .Optional ("default_media_player" ): _MEDIA_PLAYER ,
259+ vol .Optional ("default_media_player" , default = []): _MEDIA_PLAYER ,
260260 })
261261 return self .async_show_form (step_id = "add_first_channel" , data_schema = schema , errors = errors )
262262
@@ -419,7 +419,7 @@ async def async_step_add_channel(self, user_input=None):
419419 "target" : (user_input .get ("target" ) or "" ).strip (),
420420 "is_voice" : user_input .get ("is_voice" , False ),
421421 "alt_services" : alt_services ,
422- "default_media_player" : ( user_input .get ("default_media_player" ) or "" ). strip () ,
422+ "default_media_player" : user_input .get ("default_media_player" , [ "" ])[ 0 ] if user_input . get ( "default_media_player" ) else "" ,
423423 }
424424 self ._current_options ["channels" ] = channels
425425 return self ._save ()
@@ -430,7 +430,7 @@ async def async_step_add_channel(self, user_input=None):
430430 vol .Optional ("target" , default = "" ): _TEXT ,
431431 vol .Optional ("is_voice" , default = False ): _BOOL ,
432432 vol .Optional ("alt_services" , default = "{}" ): _MULTILINE ,
433- vol .Optional ("default_media_player" ): _MEDIA_PLAYER ,
433+ vol .Optional ("default_media_player" , default = []): _MEDIA_PLAYER ,
434434 })
435435 return self .async_show_form (step_id = "add_channel" , data_schema = schema , errors = errors )
436436
0 commit comments