01 "four_way_switch": 02  03 # turn on conditions 04 - 05  When: {switch: "on", reset: "off"} 06  State: {pole1: "on", pole2: "off", light_sense: "off", switch: "on", reset: "off"} 07  Then: {pole1: "off", pole2: "on"} 08 - 09  When: {switch: "on", reset: "off"} 10  State: {pole1: "off", pole2: "on", light_sense: "off", switch: "on", reset: "off"} 11  Then: {pole1: "on", pole2: "off"} 12  13 # turn off conditions 14 - 15  When: {switch: "off", reset: "off"} 16  State: {pole1: "on", pole2: "off", light_sense: "on", switch: "off", reset: "off"} 17  Then: {pole1: "off", pole2: "on"} 18 - 19  When: {switch: "off", reset: "off"} 20  State: {pole1: "off", pole2: "on", light_sense: "on", switch: "off", reset: "off"} 21  Then: {pole1: "on", pole2: "off"} 22 - 23 # init state 24  When: {reset: "on"} 25  Then: {pole1: "on", pole2: "off"}