From fa5bea050ccfc4837cad1f43bb9d9edc91443d53 Mon Sep 17 00:00:00 2001
From: Erick Hitter <services@ethitter.com>
Date: Tue, 27 Dec 2016 12:39:06 -0800
Subject: [PATCH] Update README for latest configuration changes

---
 README.md | 98 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 75 insertions(+), 23 deletions(-)

diff --git a/README.md b/README.md
index d2ebb36..2e52dae 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ Yes. See https://ethtiter.com/ for a `systemd` service file.
 
 **How is the `buttons` property of `config.json` structured?**
 
-Each object within the `buttons` property is structured according to how the button should respond to the entity's current state. For example, if the light is off, what should a button press do.
+Each object within the `buttons` property is structured according what effect the click should have on an entity in its current state. For example, if the light is off, what should a single-click do.
 
 	"mac": {
 		"mac": "mac",
@@ -40,15 +40,17 @@ Each object within the `buttons` property is structured according to how the but
 		"status": {
 			"entity_id": "switch.lamp"
 		},
-		"off": {
-			"entity": "switch",
-			"entity_id": "switch.lamp",
-			"entity_action": "turn_on"
-		},
-		"on": {
-			"entity": "switch",
-			"entity_id": "switch.lamp",
-			"entity_action": "turn_off"
+		"single": {
+			"on": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_off"
+			},
+			"off": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_on"
+			}
 		}
 	}
 
@@ -60,21 +62,71 @@ The above example simply switches a light on and off, depending on its current s
 		"status": {
 			"entity_id": "alarm_control_panel.shm"
 		},
-		"disarmed": {
-			"entity": "alarm_control_panel",
-			"entity_id": "alarm_control_panel.shm",
-			"entity_action": "alarm_arm_home"
+		"single": {
+			"disarmed": {
+				"entity": "alarm_control_panel",
+				"entity_id": "alarm_control_panel.shm",
+				"entity_action": "alarm_arm_home"
+			},
+			"armed_home": {
+				"entity": "alarm_control_panel",
+				"entity_id": "alarm_control_panel.shm",
+				"entity_action": "alarm_disarm"
+			},
+			"armed_away": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_on"
+			}
+		}
+	}
+
+In this example, if the alarm isn't active, or is set to the "armed home" state, its Flic button will toggle between those states. If, however, one tried to use the button to disable the alarm when no one is home (motion sensors are active, among other changes), the button will simply turn on a light; it won't disarm the alarm, as that's something I only allow for those who have access to Home Assistant or SmartThings directly.
+
+As three click types--`single`, `double`, and `hold`--are supported, adding responses to the new click types is a matter of updating `config.json` to define how those clicks are handled.
+
+	"mac": {
+		"mac": "mac",
+		"label": "Lamp",
+		"status": {
+			"entity_id": "switch.lamp"
+		},
+		"single": {
+			"on": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_off"
+			},
+			"off": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_on"
+			}
 		},
-		"armed_home": {
-			"entity": "alarm_control_panel",
-			"entity_id": "alarm_control_panel.shm",
-			"entity_action": "alarm_disarm"
+		"double": {
+			"on": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_off"
+			},
+			"off": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_on"
+			}
 		},
-		"armed_away": {
-			"entity": "switch",
-			"entity_id": "switch.lamp",
-			"entity_action": "turn_on"
+		"hold": {
+			"on": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_off"
+			},
+			"off": {
+				"entity": "switch",
+				"entity_id": "switch.lamp",
+				"entity_action": "turn_on"
+			}
 		}
 	}
 
-In this example, if the alarm isn't active, or is set to the "armed home" state, its Flic button will toggle between those states. If, however, one tried to use the button to disable the alarm when no one is home (motion sensors are active, among other changes), the button will simply turn on a light; it won't disarm the alarm, as that's something I only allow for those who have access to Home Assistant or SmartThings directly.
+This isn't a particularly interesting example, as all three click types perform the same action, but it demonstrates what's possible.
-- 
GitLab