#NEWLINE# def turn_off( hass , entity_id = None ) : #NEWLINE# #INDENT# 'Turn off specified media player or all.' #NEWLINE# data = ( { #NEWLINE# #INDENT# ATTR_ENTITY_ID : entity_id , #NEWLINE# #UNINDENT# } if hass else { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# hass . services . call ( DOMAIN , SERVICE_TURN_OFF , data )