Keeping pest deterrant device running during power outage
The $1 solution:







simulate this circuit &ndash; Schematic created using CircuitLab

How it works:

AC/DC output voltages tend to be a little higher than rated and batteries tend to be a little bit lower. The 2-diode wired-or configuration means that the higher voltage supply will "win" (sourcing most of the current to the device). 

That means the AC power supply will provide the device power when available, but after the voltage falls (no AC power available), the battery will take over and provide power. 

The advantages of this configuration are that it's cheap, easy to make, and make-before-break (there is never a point where power is interrupted while switching over). The disadvantages are that it's not the most efficient possible solution due to the voltage losses in the diodes.