def _add_entities(hass, entity_ids):
 attributes = {'test_attr': 5, 'test_attr_10': 'nice'}
 for (idx, entity_id) in enumerate(entity_ids):
  hass.states.set(entity_id, 'state{}'.format(idx), attributes)
  hass.block_till_done()
 recorder._INSTANCE.block_till_done()
 db_states = recorder.query('States')
 states = recorder.execute(db_states)
 assert (db_states[0].event_id is not None)
 return states

def _add_entities ( hass , entity_ids ) : attributes = { 'test_attr' : 5 , 'test_attr_10' : 'nice' } for ( idx , entity_id ) in enumerate ( entity_ids ) : hass . states . set ( entity_id , 'state{}' . format ( idx ) , attributes ) hass . block_till_done ( ) recorder . _INSTANCE . block_till_done ( ) db_states = recorder . query ( 'States' ) states = recorder . execute ( db_states ) assert ( db_states [ 0 ] . event_id is not None ) return states
add entities .