prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Hue dimmer (rwl020) off short press
  Hi,
  
  I have Hue Dimmer controller integrated in Hass Core via ZHA and Bellows (zigpy). The quirk is set to a [long press of the Off button as show here](https://github.com/dmulcahey/zha-device-handlers/blob/5c726a717a4d1dc3930b177f346e852bede9ee63/zhaquirks/philips/rwl021.py#L117). However it seems device is sending this on the short press and not sending any long press for the Off button. The event on Hass is:
  
  ```
  {
      "event_type": "zha_event",
      "data": {
          "unique_id": "xx:xx:xx:xx:xx:1:0x0006",
          "device_ieee": "xx:xx:xx:xx",
          "endpoint_id": 1,
          "cluster_id": 6,
          "command": "off_with_effect",
          "args": [
              0,
              0
          ]
      },
      "origin": "LOCAL",
      "time_fired": "2020-03-05T05:49:25.119524+00:00",
      "context": {
          "id": "xxxxxxxxxxxx",
          "parent_id": null,
          "user_id": null
      }
  }
  ```
  Based on quirk code, it should be `long press` with no args but it is `short press` with `args [0,0]`.
  
  This hue dimmer is with latest firmware (upgraded using Hue bridge before paring dimmer with ZHA).
  
  Thanks.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `zhaquirks/philips/rwl021.py`
  Content:
  ```
  1 """Phillips RWL021 device."""
  2 from zigpy.profiles import zha, zll
  3 from zigpy.quirks import CustomCluster, CustomDevice
  4 import zigpy.types as t
  5 from zigpy.zcl.clusters.general import (
  6     Basic,
  7     BinaryInput,
  8     Groups,
  9     Identify,
  10     LevelControl,
  11     OnOff,
  12     Ota,
  13     PowerConfiguration,
  14     Scenes,
  15 )
  16 
  17 from ..const import (
  18     ARGS,
  19     CLUSTER_ID,
  20     COMMAND,
  21     COMMAND_OFF_WITH_EFFECT,
  22     COMMAND_ON,
  23     COMMAND_STEP,
  24     DEVICE_TYPE,
  25     DIM_DOWN,
  26     DIM_UP,
  27     ENDPOINT_ID,
  28     ENDPOINTS,
  29     INPUT_CLUSTERS,
  30     LONG_PRESS,
  31     OUTPUT_CLUSTERS,
  32     PROFILE_ID,
  33     SHORT_PRESS,
  34     TURN_OFF,
  35     TURN_ON,
  36 )
  37 
  38 DIAGNOSTICS_CLUSTER_ID = 0x0B05  # decimal = 2821
  39 
  40 
  41 class BasicCluster(CustomCluster, Basic):
  42     """Centralite acceleration cluster."""
  43 
  44     attributes = Basic.attributes.copy()
  45     attributes.update({0x0031: ("phillips", t.bitmap16)})
  46 
  47 
  48 class PhilipsRWL021(CustomDevice):
  49     """Phillips RWL021 device."""
  50 
  51     signature = {
  52         #  <SimpleDescriptor endpoint=1 profile=49246 device_type=2096
  53         #  device_version=2
  54         #  input_clusters=[0]
  55         #  output_clusters=[0, 3, 4, 6, 8, 5]>
  56         ENDPOINTS: {
  57             1: {
  58                 PROFILE_ID: zll.PROFILE_ID,
  59                 DEVICE_TYPE: zll.DeviceType.SCENE_CONTROLLER,
  60                 INPUT_CLUSTERS: [Basic.cluster_id],
  61                 OUTPUT_CLUSTERS: [
  62                     Basic.cluster_id,
  63                     Identify.cluster_id,
  64                     Groups.cluster_id,
  65                     OnOff.cluster_id,
  66                     LevelControl.cluster_id,
  67                     Scenes.cluster_id,
  68                 ],
  69             },
  70             #  <SimpleDescriptor endpoint=2 profile=260 device_type=12
  71             #  device_version=0
  72             #  input_clusters=[0, 1, 3, 15, 64512]
  73             #  output_clusters=[25]>
  74             2: {
  75                 PROFILE_ID: zha.PROFILE_ID,
  76                 DEVICE_TYPE: zha.DeviceType.SIMPLE_SENSOR,
  77                 INPUT_CLUSTERS: [
  78                     Basic.cluster_id,
  79                     PowerConfiguration.cluster_id,
  80                     Identify.cluster_id,
  81                     BinaryInput.cluster_id,
  82                     64512,
  83                 ],
  84                 OUTPUT_CLUSTERS: [Ota.cluster_id],
  85             },
  86         }
  87     }
  88 
  89     replacement = {
  90         ENDPOINTS: {
  91             1: {
  92                 INPUT_CLUSTERS: [Basic.cluster_id],
  93                 OUTPUT_CLUSTERS: [
  94                     Basic.cluster_id,
  95                     Identify.cluster_id,
  96                     Groups.cluster_id,
  97                     OnOff.cluster_id,
  98                     LevelControl.cluster_id,
  99                     Scenes.cluster_id,
  100                 ],
  101             },
  102             2: {
  103                 INPUT_CLUSTERS: [
  104                     BasicCluster,
  105                     PowerConfiguration.cluster_id,
  106                     Identify.cluster_id,
  107                     BinaryInput.cluster_id,
  108                     64512,
  109                 ],
  110                 OUTPUT_CLUSTERS: [Ota.cluster_id],
  111             },
  112         }
  113     }
  114 
  115     device_automation_triggers = {
  116         (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON},
  117         (LONG_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},
  118         (SHORT_PRESS, DIM_UP): {
  119             COMMAND: COMMAND_STEP,
  120             CLUSTER_ID: 8,
  121             ENDPOINT_ID: 1,
  122             ARGS: [0, 30, 9],
  123         },
  124         (LONG_PRESS, DIM_UP): {
  125             COMMAND: COMMAND_STEP,
  126             CLUSTER_ID: 8,
  127             ENDPOINT_ID: 1,
  128             ARGS: [0, 56, 9],
  129         },
  130         (SHORT_PRESS, DIM_DOWN): {
  131             COMMAND: COMMAND_STEP,
  132             CLUSTER_ID: 8,
  133             ENDPOINT_ID: 1,
  134             ARGS: [1, 30, 9],
  135         },
  136         (LONG_PRESS, DIM_DOWN): {
  137             COMMAND: COMMAND_STEP,
  138             CLUSTER_ID: 8,
  139             ENDPOINT_ID: 1,
  140             ARGS: [1, 56, 9],
  141         },
  142     }
  143
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/zhaquirks/philips/rwl021.py b/zhaquirks/philips/rwl021.py
  --- a/zhaquirks/philips/rwl021.py
  +++ b/zhaquirks/philips/rwl021.py
  @@ -114,7 +114,7 @@
   
       device_automation_triggers = {
           (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON},
  -        (LONG_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},
  +        (SHORT_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},
           (SHORT_PRESS, DIM_UP): {
               COMMAND: COMMAND_STEP,
               CLUSTER_ID: 8,
  
verification_info: {"golden_diff": "diff --git a/zhaquirks/philips/rwl021.py b/zhaquirks/philips/rwl021.py\n--- a/zhaquirks/philips/rwl021.py\n+++ b/zhaquirks/philips/rwl021.py\n@@ -114,7 +114,7 @@\n \n     device_automation_triggers = {\n         (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON},\n-        (LONG_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},\n+        (SHORT_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},\n         (SHORT_PRESS, DIM_UP): {\n             COMMAND: COMMAND_STEP,\n             CLUSTER_ID: 8,\n", "issue": "Hue dimmer (rwl020) off short press\nHi,\r\n\r\nI have Hue Dimmer controller integrated in Hass Core via ZHA and Bellows (zigpy). The quirk is set to a [long press of the Off button as show here](https://github.com/dmulcahey/zha-device-handlers/blob/5c726a717a4d1dc3930b177f346e852bede9ee63/zhaquirks/philips/rwl021.py#L117). However it seems device is sending this on the short press and not sending any long press for the Off button. The event on Hass is:\r\n\r\n```\r\n{\r\n    \"event_type\": \"zha_event\",\r\n    \"data\": {\r\n        \"unique_id\": \"xx:xx:xx:xx:xx:1:0x0006\",\r\n        \"device_ieee\": \"xx:xx:xx:xx\",\r\n        \"endpoint_id\": 1,\r\n        \"cluster_id\": 6,\r\n        \"command\": \"off_with_effect\",\r\n        \"args\": [\r\n            0,\r\n            0\r\n        ]\r\n    },\r\n    \"origin\": \"LOCAL\",\r\n    \"time_fired\": \"2020-03-05T05:49:25.119524+00:00\",\r\n    \"context\": {\r\n        \"id\": \"xxxxxxxxxxxx\",\r\n        \"parent_id\": null,\r\n        \"user_id\": null\r\n    }\r\n}\r\n```\r\nBased on quirk code, it should be `long press` with no args but it is `short press` with `args [0,0]`.\r\n\r\nThis hue dimmer is with latest firmware (upgraded using Hue bridge before paring dimmer with ZHA).\r\n\r\nThanks.\n", "before_files": [{"content": "\"\"\"Phillips RWL021 device.\"\"\"\nfrom zigpy.profiles import zha, zll\nfrom zigpy.quirks import CustomCluster, CustomDevice\nimport zigpy.types as t\nfrom zigpy.zcl.clusters.general import (\n    Basic,\n    BinaryInput,\n    Groups,\n    Identify,\n    LevelControl,\n    OnOff,\n    Ota,\n    PowerConfiguration,\n    Scenes,\n)\n\nfrom ..const import (\n    ARGS,\n    CLUSTER_ID,\n    COMMAND,\n    COMMAND_OFF_WITH_EFFECT,\n    COMMAND_ON,\n    COMMAND_STEP,\n    DEVICE_TYPE,\n    DIM_DOWN,\n    DIM_UP,\n    ENDPOINT_ID,\n    ENDPOINTS,\n    INPUT_CLUSTERS,\n    LONG_PRESS,\n    OUTPUT_CLUSTERS,\n    PROFILE_ID,\n    SHORT_PRESS,\n    TURN_OFF,\n    TURN_ON,\n)\n\nDIAGNOSTICS_CLUSTER_ID = 0x0B05  # decimal = 2821\n\n\nclass BasicCluster(CustomCluster, Basic):\n    \"\"\"Centralite acceleration cluster.\"\"\"\n\n    attributes = Basic.attributes.copy()\n    attributes.update({0x0031: (\"phillips\", t.bitmap16)})\n\n\nclass PhilipsRWL021(CustomDevice):\n    \"\"\"Phillips RWL021 device.\"\"\"\n\n    signature = {\n        #  <SimpleDescriptor endpoint=1 profile=49246 device_type=2096\n        #  device_version=2\n        #  input_clusters=[0]\n        #  output_clusters=[0, 3, 4, 6, 8, 5]>\n        ENDPOINTS: {\n            1: {\n                PROFILE_ID: zll.PROFILE_ID,\n                DEVICE_TYPE: zll.DeviceType.SCENE_CONTROLLER,\n                INPUT_CLUSTERS: [Basic.cluster_id],\n                OUTPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Identify.cluster_id,\n                    Groups.cluster_id,\n                    OnOff.cluster_id,\n                    LevelControl.cluster_id,\n                    Scenes.cluster_id,\n                ],\n            },\n            #  <SimpleDescriptor endpoint=2 profile=260 device_type=12\n            #  device_version=0\n            #  input_clusters=[0, 1, 3, 15, 64512]\n            #  output_clusters=[25]>\n            2: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SIMPLE_SENSOR,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    PowerConfiguration.cluster_id,\n                    Identify.cluster_id,\n                    BinaryInput.cluster_id,\n                    64512,\n                ],\n                OUTPUT_CLUSTERS: [Ota.cluster_id],\n            },\n        }\n    }\n\n    replacement = {\n        ENDPOINTS: {\n            1: {\n                INPUT_CLUSTERS: [Basic.cluster_id],\n                OUTPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Identify.cluster_id,\n                    Groups.cluster_id,\n                    OnOff.cluster_id,\n                    LevelControl.cluster_id,\n                    Scenes.cluster_id,\n                ],\n            },\n            2: {\n                INPUT_CLUSTERS: [\n                    BasicCluster,\n                    PowerConfiguration.cluster_id,\n                    Identify.cluster_id,\n                    BinaryInput.cluster_id,\n                    64512,\n                ],\n                OUTPUT_CLUSTERS: [Ota.cluster_id],\n            },\n        }\n    }\n\n    device_automation_triggers = {\n        (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON},\n        (LONG_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},\n        (SHORT_PRESS, DIM_UP): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [0, 30, 9],\n        },\n        (LONG_PRESS, DIM_UP): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [0, 56, 9],\n        },\n        (SHORT_PRESS, DIM_DOWN): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [1, 30, 9],\n        },\n        (LONG_PRESS, DIM_DOWN): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [1, 56, 9],\n        },\n    }\n", "path": "zhaquirks/philips/rwl021.py"}], "after_files": [{"content": "\"\"\"Phillips RWL021 device.\"\"\"\nfrom zigpy.profiles import zha, zll\nfrom zigpy.quirks import CustomCluster, CustomDevice\nimport zigpy.types as t\nfrom zigpy.zcl.clusters.general import (\n    Basic,\n    BinaryInput,\n    Groups,\n    Identify,\n    LevelControl,\n    OnOff,\n    Ota,\n    PowerConfiguration,\n    Scenes,\n)\n\nfrom ..const import (\n    ARGS,\n    CLUSTER_ID,\n    COMMAND,\n    COMMAND_OFF_WITH_EFFECT,\n    COMMAND_ON,\n    COMMAND_STEP,\n    DEVICE_TYPE,\n    DIM_DOWN,\n    DIM_UP,\n    ENDPOINT_ID,\n    ENDPOINTS,\n    INPUT_CLUSTERS,\n    LONG_PRESS,\n    OUTPUT_CLUSTERS,\n    PROFILE_ID,\n    SHORT_PRESS,\n    TURN_OFF,\n    TURN_ON,\n)\n\nDIAGNOSTICS_CLUSTER_ID = 0x0B05  # decimal = 2821\n\n\nclass BasicCluster(CustomCluster, Basic):\n    \"\"\"Centralite acceleration cluster.\"\"\"\n\n    attributes = Basic.attributes.copy()\n    attributes.update({0x0031: (\"phillips\", t.bitmap16)})\n\n\nclass PhilipsRWL021(CustomDevice):\n    \"\"\"Phillips RWL021 device.\"\"\"\n\n    signature = {\n        #  <SimpleDescriptor endpoint=1 profile=49246 device_type=2096\n        #  device_version=2\n        #  input_clusters=[0]\n        #  output_clusters=[0, 3, 4, 6, 8, 5]>\n        ENDPOINTS: {\n            1: {\n                PROFILE_ID: zll.PROFILE_ID,\n                DEVICE_TYPE: zll.DeviceType.SCENE_CONTROLLER,\n                INPUT_CLUSTERS: [Basic.cluster_id],\n                OUTPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Identify.cluster_id,\n                    Groups.cluster_id,\n                    OnOff.cluster_id,\n                    LevelControl.cluster_id,\n                    Scenes.cluster_id,\n                ],\n            },\n            #  <SimpleDescriptor endpoint=2 profile=260 device_type=12\n            #  device_version=0\n            #  input_clusters=[0, 1, 3, 15, 64512]\n            #  output_clusters=[25]>\n            2: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SIMPLE_SENSOR,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    PowerConfiguration.cluster_id,\n                    Identify.cluster_id,\n                    BinaryInput.cluster_id,\n                    64512,\n                ],\n                OUTPUT_CLUSTERS: [Ota.cluster_id],\n            },\n        }\n    }\n\n    replacement = {\n        ENDPOINTS: {\n            1: {\n                INPUT_CLUSTERS: [Basic.cluster_id],\n                OUTPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Identify.cluster_id,\n                    Groups.cluster_id,\n                    OnOff.cluster_id,\n                    LevelControl.cluster_id,\n                    Scenes.cluster_id,\n                ],\n            },\n            2: {\n                INPUT_CLUSTERS: [\n                    BasicCluster,\n                    PowerConfiguration.cluster_id,\n                    Identify.cluster_id,\n                    BinaryInput.cluster_id,\n                    64512,\n                ],\n                OUTPUT_CLUSTERS: [Ota.cluster_id],\n            },\n        }\n    }\n\n    device_automation_triggers = {\n        (SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON},\n        (SHORT_PRESS, TURN_OFF): {COMMAND: COMMAND_OFF_WITH_EFFECT},\n        (SHORT_PRESS, DIM_UP): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [0, 30, 9],\n        },\n        (LONG_PRESS, DIM_UP): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [0, 56, 9],\n        },\n        (SHORT_PRESS, DIM_DOWN): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [1, 30, 9],\n        },\n        (LONG_PRESS, DIM_DOWN): {\n            COMMAND: COMMAND_STEP,\n            CLUSTER_ID: 8,\n            ENDPOINT_ID: 1,\n            ARGS: [1, 56, 9],\n        },\n    }\n", "path": "zhaquirks/philips/rwl021.py"}]}