We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Device Support Request] New manufacturerName for DDS238-2 Zigbee
In one chat I got information that from December 2021 this device now is sending with a new manufacturerName attribute: _TZE200_ewxhg6o9. The new version also contains the fix the switch issue (see the details in the #994 thread) and maybe something else, like EnergyFactor attribute.
I can update the quirck but I have no physically the new version of the DDS238-2 device to test, so if someone has the new version of device and can support me with the testing, I can help with the contribution of this update.

--- 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/tuya/ts0601_din_power.py`
Content:
```
1 """Tuya Din Power Meter."""
2 from zigpy.profiles import zha
3 import zigpy.types as t
4 from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
5 from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
6 from zigpy.zcl.clusters.smartenergy import Metering
7 
8 from zhaquirks import Bus, LocalDataCluster
9 from zhaquirks.const import (
10     DEVICE_TYPE,
11     ENDPOINTS,
12     INPUT_CLUSTERS,
13     MODELS_INFO,
14     OUTPUT_CLUSTERS,
15     PROFILE_ID,
16 )
17 from zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch
18 
19 TUYA_TOTAL_ENERGY_ATTR = 0x0211
20 TUYA_CURRENT_ATTR = 0x0212
21 TUYA_POWER_ATTR = 0x0213
22 TUYA_VOLTAGE_ATTR = 0x0214
23 TUYA_DIN_SWITCH_ATTR = 0x0101
24 
25 SWITCH_EVENT = "switch_event"
26 
27 
28 class TuyaManufClusterDinPower(TuyaManufClusterAttributes):
29     """Manufacturer Specific Cluster of the Tuya Power Meter device."""
30 
31     manufacturer_attributes = {
32         TUYA_TOTAL_ENERGY_ATTR: ("energy", t.uint16_t),
33         TUYA_CURRENT_ATTR: ("current", t.int16s),
34         TUYA_POWER_ATTR: ("power", t.uint16_t),
35         TUYA_VOLTAGE_ATTR: ("voltage", t.uint16_t),
36         TUYA_DIN_SWITCH_ATTR: ("switch", t.uint8_t),
37     }
38 
39     def _update_attribute(self, attrid, value):
40         super()._update_attribute(attrid, value)
41         if attrid == TUYA_TOTAL_ENERGY_ATTR:
42             self.endpoint.smartenergy_metering.energy_reported(value / 100)
43         elif attrid == TUYA_CURRENT_ATTR:
44             self.endpoint.electrical_measurement.current_reported(value)
45         elif attrid == TUYA_POWER_ATTR:
46             self.endpoint.electrical_measurement.power_reported(value / 10)
47         elif attrid == TUYA_VOLTAGE_ATTR:
48             self.endpoint.electrical_measurement.voltage_reported(value / 10)
49         elif attrid == TUYA_DIN_SWITCH_ATTR:
50             self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, attrid, value)
51 
52 
53 class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
54     """Custom class for power, voltage and current measurement."""
55 
56     cluster_id = ElectricalMeasurement.cluster_id
57 
58     POWER_ID = 0x050B
59     VOLTAGE_ID = 0x0505
60     CURRENT_ID = 0x0508
61 
62     AC_CURRENT_MULTIPLIER = 0x0602
63     AC_CURRENT_DIVISOR = 0x0603
64 
65     _CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}
66 
67     def voltage_reported(self, value):
68         """Voltage reported."""
69         self._update_attribute(self.VOLTAGE_ID, value)
70 
71     def power_reported(self, value):
72         """Power reported."""
73         self._update_attribute(self.POWER_ID, value)
74 
75     def current_reported(self, value):
76         """Ampers reported."""
77         self._update_attribute(self.CURRENT_ID, value)
78 
79 
80 class TuyaElectricalMeasurement(LocalDataCluster, Metering):
81     """Custom class for total energy measurement."""
82 
83     cluster_id = Metering.cluster_id
84     CURRENT_ID = 0x0000
85     POWER_WATT = 0x0000
86 
87     """Setting unit of measurement."""
88     _CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}
89 
90     def energy_reported(self, value):
91         """Summation Energy reported."""
92         self._update_attribute(self.CURRENT_ID, value)
93 
94 
95 class TuyaPowerMeter(TuyaSwitch):
96     """Tuya power meter device."""
97 
98     def __init__(self, *args, **kwargs):
99         """Init device."""
100         self.switch_bus = Bus()
101         super().__init__(*args, **kwargs)
102 
103     signature = {
104         # "node_descriptor": "<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098
105         #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264
106         #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>",
107         # device_version=1
108         # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]
109         # output_clusters=[0x000a, 0x0019]
110         MODELS_INFO: [
111             ("_TZE200_byzdayie", "TS0601"),
112         ],
113         ENDPOINTS: {
114             # <SimpleDescriptor endpoint=1 profile=260 device_type=51
115             # device_version=1
116             # input_clusters=[0, 4, 5, 61184]
117             # output_clusters=[10, 25]>
118             1: {
119                 PROFILE_ID: zha.PROFILE_ID,
120                 DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
121                 INPUT_CLUSTERS: [
122                     Basic.cluster_id,
123                     Groups.cluster_id,
124                     Scenes.cluster_id,
125                     TuyaManufClusterAttributes.cluster_id,
126                 ],
127                 OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
128             }
129         },
130     }
131 
132     replacement = {
133         ENDPOINTS: {
134             1: {
135                 PROFILE_ID: zha.PROFILE_ID,
136                 DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
137                 INPUT_CLUSTERS: [
138                     Basic.cluster_id,
139                     Groups.cluster_id,
140                     Scenes.cluster_id,
141                     TuyaManufClusterDinPower,
142                     TuyaPowerMeasurement,
143                     TuyaElectricalMeasurement,
144                     TuyaOnOff,
145                 ],
146                 OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
147             }
148         }
149     }
150
```
--- 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()

```

diff --git a/zhaquirks/tuya/ts0601_din_power.py b/zhaquirks/tuya/ts0601_din_power.py
--- a/zhaquirks/tuya/ts0601_din_power.py
+++ b/zhaquirks/tuya/ts0601_din_power.py
@@ -47,7 +47,9 @@
         elif attrid == TUYA_VOLTAGE_ATTR:
             self.endpoint.electrical_measurement.voltage_reported(value / 10)
         elif attrid == TUYA_DIN_SWITCH_ATTR:
-            self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, attrid, value)
+            self.endpoint.device.switch_bus.listener_event(
+                SWITCH_EVENT, self.endpoint.endpoint_id, value
+            )
 
 
 class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):
@@ -109,6 +111,7 @@
         # output_clusters=[0x000a, 0x0019]
         MODELS_INFO: [
             ("_TZE200_byzdayie", "TS0601"),
+            ("_TZE200_ewxhg6o9", "TS0601"),
         ],
         ENDPOINTS: {
             # <SimpleDescriptor endpoint=1 profile=260 device_type=51

{"golden_diff": "diff --git a/zhaquirks/tuya/ts0601_din_power.py b/zhaquirks/tuya/ts0601_din_power.py\n--- a/zhaquirks/tuya/ts0601_din_power.py\n+++ b/zhaquirks/tuya/ts0601_din_power.py\n@@ -47,7 +47,9 @@\n         elif attrid == TUYA_VOLTAGE_ATTR:\n             self.endpoint.electrical_measurement.voltage_reported(value / 10)\n         elif attrid == TUYA_DIN_SWITCH_ATTR:\n-            self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, attrid, value)\n+            self.endpoint.device.switch_bus.listener_event(\n+                SWITCH_EVENT, self.endpoint.endpoint_id, value\n+            )\n \n \n class TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):\n@@ -109,6 +111,7 @@\n         # output_clusters=[0x000a, 0x0019]\n         MODELS_INFO: [\n             (\"_TZE200_byzdayie\", \"TS0601\"),\n+            (\"_TZE200_ewxhg6o9\", \"TS0601\"),\n         ],\n         ENDPOINTS: {\n             # <SimpleDescriptor endpoint=1 profile=260 device_type=51\n", "issue": "[Device Support Request] New manufacturerName for DDS238-2 Zigbee\nIn one chat I got information that from December 2021 this device now is sending with a new manufacturerName attribute: _TZE200_ewxhg6o9. The new version also contains the fix the switch issue (see the details in the #994 thread) and maybe something else, like EnergyFactor attribute.\r\nI can update the quirck but I have no physically the new version of the DDS238-2 device to test, so if someone has the new version of device and can support me with the testing, I can help with the contribution of this update.\n", "before_files": [{"content": "\"\"\"Tuya Din Power Meter.\"\"\"\nfrom zigpy.profiles import zha\nimport zigpy.types as t\nfrom zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time\nfrom zigpy.zcl.clusters.homeautomation import ElectricalMeasurement\nfrom zigpy.zcl.clusters.smartenergy import Metering\n\nfrom zhaquirks import Bus, LocalDataCluster\nfrom zhaquirks.const import (\n    DEVICE_TYPE,\n    ENDPOINTS,\n    INPUT_CLUSTERS,\n    MODELS_INFO,\n    OUTPUT_CLUSTERS,\n    PROFILE_ID,\n)\nfrom zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch\n\nTUYA_TOTAL_ENERGY_ATTR = 0x0211\nTUYA_CURRENT_ATTR = 0x0212\nTUYA_POWER_ATTR = 0x0213\nTUYA_VOLTAGE_ATTR = 0x0214\nTUYA_DIN_SWITCH_ATTR = 0x0101\n\nSWITCH_EVENT = \"switch_event\"\n\n\nclass TuyaManufClusterDinPower(TuyaManufClusterAttributes):\n    \"\"\"Manufacturer Specific Cluster of the Tuya Power Meter device.\"\"\"\n\n    manufacturer_attributes = {\n        TUYA_TOTAL_ENERGY_ATTR: (\"energy\", t.uint16_t),\n        TUYA_CURRENT_ATTR: (\"current\", t.int16s),\n        TUYA_POWER_ATTR: (\"power\", t.uint16_t),\n        TUYA_VOLTAGE_ATTR: (\"voltage\", t.uint16_t),\n        TUYA_DIN_SWITCH_ATTR: (\"switch\", t.uint8_t),\n    }\n\n    def _update_attribute(self, attrid, value):\n        super()._update_attribute(attrid, value)\n        if attrid == TUYA_TOTAL_ENERGY_ATTR:\n            self.endpoint.smartenergy_metering.energy_reported(value / 100)\n        elif attrid == TUYA_CURRENT_ATTR:\n            self.endpoint.electrical_measurement.current_reported(value)\n        elif attrid == TUYA_POWER_ATTR:\n            self.endpoint.electrical_measurement.power_reported(value / 10)\n        elif attrid == TUYA_VOLTAGE_ATTR:\n            self.endpoint.electrical_measurement.voltage_reported(value / 10)\n        elif attrid == TUYA_DIN_SWITCH_ATTR:\n            self.endpoint.device.switch_bus.listener_event(SWITCH_EVENT, attrid, value)\n\n\nclass TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):\n    \"\"\"Custom class for power, voltage and current measurement.\"\"\"\n\n    cluster_id = ElectricalMeasurement.cluster_id\n\n    POWER_ID = 0x050B\n    VOLTAGE_ID = 0x0505\n    CURRENT_ID = 0x0508\n\n    AC_CURRENT_MULTIPLIER = 0x0602\n    AC_CURRENT_DIVISOR = 0x0603\n\n    _CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}\n\n    def voltage_reported(self, value):\n        \"\"\"Voltage reported.\"\"\"\n        self._update_attribute(self.VOLTAGE_ID, value)\n\n    def power_reported(self, value):\n        \"\"\"Power reported.\"\"\"\n        self._update_attribute(self.POWER_ID, value)\n\n    def current_reported(self, value):\n        \"\"\"Ampers reported.\"\"\"\n        self._update_attribute(self.CURRENT_ID, value)\n\n\nclass TuyaElectricalMeasurement(LocalDataCluster, Metering):\n    \"\"\"Custom class for total energy measurement.\"\"\"\n\n    cluster_id = Metering.cluster_id\n    CURRENT_ID = 0x0000\n    POWER_WATT = 0x0000\n\n    \"\"\"Setting unit of measurement.\"\"\"\n    _CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}\n\n    def energy_reported(self, value):\n        \"\"\"Summation Energy reported.\"\"\"\n        self._update_attribute(self.CURRENT_ID, value)\n\n\nclass TuyaPowerMeter(TuyaSwitch):\n    \"\"\"Tuya power meter device.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Init device.\"\"\"\n        self.switch_bus = Bus()\n        super().__init__(*args, **kwargs)\n\n    signature = {\n        # \"node_descriptor\": \"<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098\n        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264\n        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>\",\n        # device_version=1\n        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]\n        # output_clusters=[0x000a, 0x0019]\n        MODELS_INFO: [\n            (\"_TZE200_byzdayie\", \"TS0601\"),\n        ],\n        ENDPOINTS: {\n            # <SimpleDescriptor endpoint=1 profile=260 device_type=51\n            # device_version=1\n            # input_clusters=[0, 4, 5, 61184]\n            # output_clusters=[10, 25]>\n            1: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Groups.cluster_id,\n                    Scenes.cluster_id,\n                    TuyaManufClusterAttributes.cluster_id,\n                ],\n                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],\n            }\n        },\n    }\n\n    replacement = {\n        ENDPOINTS: {\n            1: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Groups.cluster_id,\n                    Scenes.cluster_id,\n                    TuyaManufClusterDinPower,\n                    TuyaPowerMeasurement,\n                    TuyaElectricalMeasurement,\n                    TuyaOnOff,\n                ],\n                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],\n            }\n        }\n    }\n", "path": "zhaquirks/tuya/ts0601_din_power.py"}], "after_files": [{"content": "\"\"\"Tuya Din Power Meter.\"\"\"\nfrom zigpy.profiles import zha\nimport zigpy.types as t\nfrom zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time\nfrom zigpy.zcl.clusters.homeautomation import ElectricalMeasurement\nfrom zigpy.zcl.clusters.smartenergy import Metering\n\nfrom zhaquirks import Bus, LocalDataCluster\nfrom zhaquirks.const import (\n    DEVICE_TYPE,\n    ENDPOINTS,\n    INPUT_CLUSTERS,\n    MODELS_INFO,\n    OUTPUT_CLUSTERS,\n    PROFILE_ID,\n)\nfrom zhaquirks.tuya import TuyaManufClusterAttributes, TuyaOnOff, TuyaSwitch\n\nTUYA_TOTAL_ENERGY_ATTR = 0x0211\nTUYA_CURRENT_ATTR = 0x0212\nTUYA_POWER_ATTR = 0x0213\nTUYA_VOLTAGE_ATTR = 0x0214\nTUYA_DIN_SWITCH_ATTR = 0x0101\n\nSWITCH_EVENT = \"switch_event\"\n\n\nclass TuyaManufClusterDinPower(TuyaManufClusterAttributes):\n    \"\"\"Manufacturer Specific Cluster of the Tuya Power Meter device.\"\"\"\n\n    manufacturer_attributes = {\n        TUYA_TOTAL_ENERGY_ATTR: (\"energy\", t.uint16_t),\n        TUYA_CURRENT_ATTR: (\"current\", t.int16s),\n        TUYA_POWER_ATTR: (\"power\", t.uint16_t),\n        TUYA_VOLTAGE_ATTR: (\"voltage\", t.uint16_t),\n        TUYA_DIN_SWITCH_ATTR: (\"switch\", t.uint8_t),\n    }\n\n    def _update_attribute(self, attrid, value):\n        super()._update_attribute(attrid, value)\n        if attrid == TUYA_TOTAL_ENERGY_ATTR:\n            self.endpoint.smartenergy_metering.energy_reported(value / 100)\n        elif attrid == TUYA_CURRENT_ATTR:\n            self.endpoint.electrical_measurement.current_reported(value)\n        elif attrid == TUYA_POWER_ATTR:\n            self.endpoint.electrical_measurement.power_reported(value / 10)\n        elif attrid == TUYA_VOLTAGE_ATTR:\n            self.endpoint.electrical_measurement.voltage_reported(value / 10)\n        elif attrid == TUYA_DIN_SWITCH_ATTR:\n            self.endpoint.device.switch_bus.listener_event(\n                SWITCH_EVENT, self.endpoint.endpoint_id, value\n            )\n\n\nclass TuyaPowerMeasurement(LocalDataCluster, ElectricalMeasurement):\n    \"\"\"Custom class for power, voltage and current measurement.\"\"\"\n\n    cluster_id = ElectricalMeasurement.cluster_id\n\n    POWER_ID = 0x050B\n    VOLTAGE_ID = 0x0505\n    CURRENT_ID = 0x0508\n\n    AC_CURRENT_MULTIPLIER = 0x0602\n    AC_CURRENT_DIVISOR = 0x0603\n\n    _CONSTANT_ATTRIBUTES = {AC_CURRENT_MULTIPLIER: 1, AC_CURRENT_DIVISOR: 1000}\n\n    def voltage_reported(self, value):\n        \"\"\"Voltage reported.\"\"\"\n        self._update_attribute(self.VOLTAGE_ID, value)\n\n    def power_reported(self, value):\n        \"\"\"Power reported.\"\"\"\n        self._update_attribute(self.POWER_ID, value)\n\n    def current_reported(self, value):\n        \"\"\"Ampers reported.\"\"\"\n        self._update_attribute(self.CURRENT_ID, value)\n\n\nclass TuyaElectricalMeasurement(LocalDataCluster, Metering):\n    \"\"\"Custom class for total energy measurement.\"\"\"\n\n    cluster_id = Metering.cluster_id\n    CURRENT_ID = 0x0000\n    POWER_WATT = 0x0000\n\n    \"\"\"Setting unit of measurement.\"\"\"\n    _CONSTANT_ATTRIBUTES = {0x0300: POWER_WATT}\n\n    def energy_reported(self, value):\n        \"\"\"Summation Energy reported.\"\"\"\n        self._update_attribute(self.CURRENT_ID, value)\n\n\nclass TuyaPowerMeter(TuyaSwitch):\n    \"\"\"Tuya power meter device.\"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Init device.\"\"\"\n        self.switch_bus = Bus()\n        super().__init__(*args, **kwargs)\n\n    signature = {\n        # \"node_descriptor\": \"<NodeDescriptor byte1=1 byte2=64 mac_capability_flags=142 manufacturer_code=4098\n        #                       maximum_buffer_size=82 maximum_incoming_transfer_size=82 server_mask=11264\n        #                       maximum_outgoing_transfer_size=82 descriptor_capability_field=0>\",\n        # device_version=1\n        # input_clusters=[0x0000, 0x0004, 0x0005, 0xef00]\n        # output_clusters=[0x000a, 0x0019]\n        MODELS_INFO: [\n            (\"_TZE200_byzdayie\", \"TS0601\"),\n            (\"_TZE200_ewxhg6o9\", \"TS0601\"),\n        ],\n        ENDPOINTS: {\n            # <SimpleDescriptor endpoint=1 profile=260 device_type=51\n            # device_version=1\n            # input_clusters=[0, 4, 5, 61184]\n            # output_clusters=[10, 25]>\n            1: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Groups.cluster_id,\n                    Scenes.cluster_id,\n                    TuyaManufClusterAttributes.cluster_id,\n                ],\n                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],\n            }\n        },\n    }\n\n    replacement = {\n        ENDPOINTS: {\n            1: {\n                PROFILE_ID: zha.PROFILE_ID,\n                DEVICE_TYPE: zha.DeviceType.SMART_PLUG,\n                INPUT_CLUSTERS: [\n                    Basic.cluster_id,\n                    Groups.cluster_id,\n                    Scenes.cluster_id,\n                    TuyaManufClusterDinPower,\n                    TuyaPowerMeasurement,\n                    TuyaElectricalMeasurement,\n                    TuyaOnOff,\n                ],\n                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],\n            }\n        }\n    }\n", "path": "zhaquirks/tuya/ts0601_din_power.py"}]}