A while back in one of my earlier posts, I was cautioned against bringing in python data structures from the appdaemon.cfg file. I’m trying to get my apps more in line with how AD would typically want them to be. But to do that I need to bring in a configuration information that tells the app how to process a certain room or light. If I shouldn’t bring a data structure (dictionary) in from the config file. How do I get the data to the application? Here is a draft of the data structure below.
targets={“light.overhead_light”:{“triggers”:{“light.overhead_light”:{“bit”:8,”onValue”:”on”},
“device_tracker.scox0129_sc0129”:{“bit”:4,”onValue”:”home”},
“media_player.sam_directv”:{“bit”:1,”onValue”:”playing”},
“sensor.sam_motion”:{“bit”:2,”onValue”:8},
“input_boolean.samishomeoverride”:{“bit”:16,”onValue”:”on”}},
“type”:”light”,
“onState”:[11,12,13,14,15,16,27,28,29,30,31,32],
“callback”:self.light_state_handler},
“light.sam_fan_switch”:{“triggers”:{“light.sam_fan_switch”:{“bit”:1,”onValue”:”on”},
“sensor.sam_temperature”:{“bit”:2,”onValue”:self.check_temp},
“input_boolean.samishomeoverride”:{“bit”:4,”onValue”:”on”},
“device_tracker.scox0129_sc0129”:{“bit”:8,”onValue”:”home”}}
“type”:”fan”,
“onState”:[11,12,13,14,15,16,27,28,29,30,31,32],
“callback”:self.fan_state_handler}
}