#NEWLINE# def _format_devices( self , devices ) : #NEWLINE# #INDENT# formatted = [ { #NEWLINE# #INDENT# 'text' : '*Device Name*: {}' . format ( device [ 'name' ] ) , #NEWLINE# 'color' : COLOR , #NEWLINE# 'mrkdwn_in' : [ 'text' ] , #NEWLINE# 'fields' : [ { #NEWLINE# #INDENT# 'title' : 'Group' , #NEWLINE# 'value' : ( device . get ( 'group' ) if device . get ( 'group' ) else 'Ungrouped' ) , #NEWLINE# 'short' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'title' : 'Provider' , #NEWLINE# 'value' : ( device . get ( 'provider' ) if device . get ( 'provider' ) else 'No provider' ) , #NEWLINE# 'short' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'title' : 'Id' , #NEWLINE# 'value' : device . get ( '_id' ) , #NEWLINE# 'short' : True , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'title' : 'Online Status' , #NEWLINE# 'value' : self . online_status ( device . get ( 'lastPayloadAt' , '' ) ) , #NEWLINE# 'short' : True , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } for device in devices ] #NEWLINE# return formatted