#NEWLINE# def test_service_call_to_command( self ) : #NEWLINE# #INDENT# 'Test service call to command.' #NEWLINE# config = self . config_children_only #NEWLINE# config [ 'commands' ] = { #NEWLINE# #INDENT# 'turn_off' : { #NEWLINE# #INDENT# 'service' : 'test.turn_off' , #NEWLINE# 'data' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# universal . validate_config ( self ) #NEWLINE# service = mock_service ( self . hass , 'test' , 'turn_off' ) #NEWLINE# ump = universal . UniversalMediaPlayer ( self . hass , ** config ) #NEWLINE# ump . entity_id = media_player . ENTITY_ID_FORMAT . format ( config [ 'name' ] ) #NEWLINE# ump . update ( ) #NEWLINE# self . mock_mp_2 . _state = STATE_PLAYING #NEWLINE# self . mock_mp_2 . update_ha_state ( ) #NEWLINE# ump . update ( ) #NEWLINE# ump . turn_off ( ) #NEWLINE# self . assertEqual ( 1 , len ( service ) )