@RandomHassUser wrote:
Hopefully an easy question to answer, I cannot seem to call a def from another def (possibly due to the way hass wraps script files?)
Example:
global gLogger gLogger = logger def one(): gLogger.info("one") two() def two(): gLogger.info("two") one()
Executing this python script gives me:
Error executing script: name 'two' is not defined
Does hass wrap these scripts in a way where I need to call a parent method to access the other defs? Could someone demonstrate the proper way to call two from the one definition in this scenario?
Posts: 2
Participants: 1