Edit: Oops, this is what I was thinking of, not quite the same thing.
“Furthermore, you should recollect the devas: ‘There are the devas of the
Four Great Kings, the devas of the Thirty-three, the devas of the Hours, the
Contented Devas, the devas who delight in creation, the devas who have power
over the creations of others, the devas of Brahm›’s retinue, the devas beyond
them. Whatever conviction they were endowed with that—when falling away
from this life—they re-arose there, the same sort of conviction is present in me
as well. Whatever virtue they were endowed with that—when falling away from
this life—they re-arose there, the same sort of virtue is present in me as well.
Whatever learning they were endowed with that—when falling away from this
life—they re-arose there, the same sort of learning is present in me as well.
Whatever generosity they were endowed with that—when falling away from this
life—they re-arose there, the same sort of generosity is present in me as well.
Whatever discernment they were endowed with that—when falling away from
this life—they re-arose there, the same sort of discernment is present in me as
well.’ At any time when a disciple of the noble ones is recollecting the conviction,
virtue, learning, generosity, and discernment found both in himself and the
devas, his mind is not overcome with passion, not overcome with aversion, not
overcome with delusion. His mind heads straight, based on the (qualities of the)
devas. And when the mind is headed straight, the disciple of the noble ones gains
a sense of the goal, gains a sense of the Dhamma, gains joy connected with the
Dhamma. In one who is joyful, rapture arises. In one who is rapturous, the body
grows calm. One whose body is calmed experiences ease. In one at ease, the
mind becomes concentrated.
“Mah›n›ma, you should develop this recollection of the devas while you are
walking, while you are standing, while you are sitting, while you are lying down,
while you are busy at work, while you are resting in your home crowded with
children.” — AN 9:13