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