#NEWLINE# def trigger_event( name , event , value1 = None , value2 = None , value3 = None ) : #NEWLINE# #INDENT# "\n    Trigger an event in IFTTT\n\n    .. code-block:: yaml\n\n        ifttt-event:\n          ifttt.trigger_event:\n            - event: TestEvent\n            - value1: 'A value that we want to send.'\n            - value2: 'A second value that we want to send.'\n            - value3: 'A third value that wen want to send.'\n\n    The following parameters are required:\n\n    name\n        The unique name for this event.\n\n    event\n        The name of the event to trigger in IFTTT.\n\n    The following parameters are optional:\n\n    value1\n        One of the values that we can send to IFTT.\n\n    value2\n        One of the values that we can send to IFTT.\n\n    value3\n        One of the values that we can send to IFTT.\n    " #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'result' : False , #NEWLINE# 'comment' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'The following trigger would be sent to IFTTT: {0}' . format ( event ) #NEWLINE# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# ret [ 'result' ] = __salt__ [ 'ifttt.trigger_event' ] ( event = event , value1 = value1 , value2 = value2 , value3 = value3 ) #NEWLINE# if ( ret and ret [ 'result' ] ) : #NEWLINE# #INDENT# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'Triggered Event: {0}' . format ( name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Failed to trigger event: {0}' . format ( name ) #NEWLINE# #UNINDENT# return ret