diff --git a/homeassistant/components/hue/.translations/en.json b/homeassistant/components/hue/.translations/en.json index e250da7627f..c80074459e5 100644 --- a/homeassistant/components/hue/.translations/en.json +++ b/homeassistant/components/hue/.translations/en.json @@ -33,6 +33,8 @@ "button_2": "Second button", "button_3": "Third button", "button_4": "Fourth button", + "double_buttons_1_3": "First and Third buttons", + "double_buttons_2_4": "Second and Fourth buttons", "dim_down": "Dim down", "dim_up": "Dim up", "turn_off": "Turn off", @@ -41,7 +43,9 @@ "trigger_type": { "remote_button_long_release": "\"{subtype}\" button released after long press", "remote_button_short_press": "\"{subtype}\" button pressed", - "remote_button_short_release": "\"{subtype}\" button released" + "remote_button_short_release": "\"{subtype}\" button released", + "remote_double_button_long_press": "Both \"{subtype}\" released after long press", + "remote_double_button_short_press": "Both \"{subtype}\" released" } } -} \ No newline at end of file +} diff --git a/homeassistant/components/hue/device_trigger.py b/homeassistant/components/hue/device_trigger.py index 81877654746..0c90c29f4c7 100644 --- a/homeassistant/components/hue/device_trigger.py +++ b/homeassistant/components/hue/device_trigger.py @@ -26,6 +26,8 @@ CONF_SUBTYPE = "subtype" CONF_SHORT_PRESS = "remote_button_short_press" CONF_SHORT_RELEASE = "remote_button_short_release" CONF_LONG_RELEASE = "remote_button_long_release" +CONF_DOUBLE_SHORT_RELEASE = "remote_double_button_short_press" +CONF_DOUBLE_LONG_RELEASE = "remote_double_button_long_press" CONF_TURN_ON = "turn_on" CONF_TURN_OFF = "turn_off" @@ -35,7 +37,8 @@ CONF_BUTTON_1 = "button_1" CONF_BUTTON_2 = "button_2" CONF_BUTTON_3 = "button_3" CONF_BUTTON_4 = "button_4" - +CONF_DOUBLE_BUTTON_1 = "double_buttons_1_3" +CONF_DOUBLE_BUTTON_2 = "double_buttons_2_4" HUE_DIMMER_REMOTE_MODEL = "Hue dimmer switch" # RWL020/021 HUE_DIMMER_REMOTE = { @@ -57,9 +60,27 @@ HUE_TAP_REMOTE = { (CONF_SHORT_PRESS, CONF_BUTTON_4): {CONF_EVENT: 18}, } +HUE_FOHSWITCH_REMOTE_MODEL = "Friends of Hue Switch" # ZGPSWITCH +HUE_FOHSWITCH_REMOTE = { + (CONF_SHORT_PRESS, CONF_BUTTON_1): {CONF_EVENT: 20}, + (CONF_LONG_RELEASE, CONF_BUTTON_1): {CONF_EVENT: 16}, + (CONF_SHORT_PRESS, CONF_BUTTON_2): {CONF_EVENT: 21}, + (CONF_LONG_RELEASE, CONF_BUTTON_2): {CONF_EVENT: 17}, + (CONF_SHORT_PRESS, CONF_BUTTON_3): {CONF_EVENT: 23}, + (CONF_LONG_RELEASE, CONF_BUTTON_3): {CONF_EVENT: 19}, + (CONF_SHORT_PRESS, CONF_BUTTON_4): {CONF_EVENT: 22}, + (CONF_LONG_RELEASE, CONF_BUTTON_4): {CONF_EVENT: 18}, + (CONF_DOUBLE_SHORT_RELEASE, CONF_DOUBLE_BUTTON_1): {CONF_EVENT: 101}, + (CONF_DOUBLE_LONG_RELEASE, CONF_DOUBLE_BUTTON_1): {CONF_EVENT: 100}, + (CONF_DOUBLE_SHORT_RELEASE, CONF_DOUBLE_BUTTON_2): {CONF_EVENT: 99}, + (CONF_DOUBLE_LONG_RELEASE, CONF_DOUBLE_BUTTON_2): {CONF_EVENT: 98}, +} + + REMOTES = { HUE_DIMMER_REMOTE_MODEL: HUE_DIMMER_REMOTE, HUE_TAP_REMOTE_MODEL: HUE_TAP_REMOTE, + HUE_FOHSWITCH_REMOTE_MODEL: HUE_FOHSWITCH_REMOTE, } TRIGGER_SCHEMA = TRIGGER_BASE_SCHEMA.extend( diff --git a/homeassistant/components/hue/strings.json b/homeassistant/components/hue/strings.json index 498a9605833..c912e9f7f0d 100644 --- a/homeassistant/components/hue/strings.json +++ b/homeassistant/components/hue/strings.json @@ -33,6 +33,8 @@ "button_2": "Second button", "button_3": "Third button", "button_4": "Fourth button", + "double_buttons_1_3": "First and Third buttons", + "double_buttons_2_4": "Second and Fourth buttons", "dim_down": "Dim down", "dim_up": "Dim up", "turn_off": "Turn off", @@ -41,7 +43,9 @@ "trigger_type": { "remote_button_long_release": "\"{subtype}\" button released after long press", "remote_button_short_press": "\"{subtype}\" button pressed", - "remote_button_short_release": "\"{subtype}\" button released" + "remote_button_short_release": "\"{subtype}\" button released", + "remote_double_button_long_press": "Both \"{subtype}\" released after long press", + "remote_double_button_short_press": "Both \"{subtype}\" released" } } }