#NEWLINE# @ service ( DOMAIN , SERVICE_FLASH ) #NEWLINE# def flash_service( hass , call ) : #NEWLINE# #INDENT# 'Service that will toggle the target.\n\n    Set the light to off for 10 seconds if on and vice versa.\n    ' #NEWLINE# if ( not TARGET_ID ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if core . is_on ( hass , TARGET_ID ) : #NEWLINE# #INDENT# core . turn_off ( hass , TARGET_ID ) #NEWLINE# time . sleep ( 10 ) #NEWLINE# core . turn_on ( hass , TARGET_ID ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# core . turn_on ( hass , TARGET_ID ) #NEWLINE# time . sleep ( 10 ) #NEWLINE# core . turn_off ( hass , TARGET_ID )