EnerNOC/oadr2-ven-python — pull request #5 by daveriess (2013-08-27 00:47:33+00:00)
Title: fix local variable ref before assignment

if the oadrEvent payload is empty and the for loop executes zero times, updated_events will be undefined when it's referenced as an argument for the event_callback. This exception is caught by the try/catch that wraps the call to the callback, and an "error in event callback" is raised before the callback is executed.

I just moved the variable init out of the for loop for now.