![]() ![]() When the sun goes below the horizon, the porch and garden lights must turn on. The following example shows how a single automation can control entities that aren’t related to each other but have in common the same trigger. wait_for_trigger : - platform : event event_type : ifttt_webhook_received event_data : action : connected_to_network timeout : minutes : " " sequence : - service : script.left_home # Wait for IFTTT event or abort after specified timeout. For all the different possibilities, have a look at the service calls page. The most important one is the action to call a service. ![]() # Example script integration containing script syntax script : example_script : sequence : # This is written using the Script Syntax - alias : " Turn on ceiling light" service : light.turn_on target : entity_id : light.ceiling - alias : " Notify that ceiling light is turned on" service : notify.notify data : message : " Turned on the ceiling light!" myMethod, 2000 ) // error: "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object" setTimeout. In fact, it will be an error because setTimeout code expects this to be the window object: setTimeout. call won't work // because this will change the value of this inside setTimeout itself // while we want to change the value of this inside myArray.myMethod. myMethod, 1500, "1" ) // prints "undefined" after 1,5 seconds // Passing the 'this' object with. myMethod, 1000 ) // prints "" after 1 second setTimeout (myArray. myMethod ( 1 ) // prints "one" setTimeout (myArray. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |