Repository: zigpy/zha-device-handlers (python)

Issue:
[Device Support Request] _TZE200_pay2byax
### Problem description

I found the model and manufacturer mentioned here under temp/humidity??

https://github.com/zigpy/zha-device-handlers/blob/57bcec8cf963499b9fca76484619ec57e4a7c088/zhaquirks/tuya/ts0601_sensor.py#L84C1-L97C23

The device works for me with that quirk. But there is a duplicate Illuminance entity and the battery type returns 3 AAA instead of the single CR2032 in the device.

So its currently "partially working"


### Solution description

The device should show correct battery type and only a single Illuminance entity.

### Screenshots/Video

<details><summary>Screenshots/Video</summary>

![image](https://github.com/user-attachments/assets/e9c204e0-1cf7-430c-8263-b4f4c6f49f1d)
![image](https://github.com/user-attachments/assets/a601c379-8aaf-4e45-b6ff-a12a9cfb2a12)

</details>


### Device signature

<details><summary>Device signature</summary>

```json
{
  "node_descriptor": {
    "logical_type": 2,
    "complex_descriptor_available": 0,
    "user_descriptor_available": 0,
    "reserved": 0,
    "aps_flags": 0,
    "frequency_band": 8,
    "mac_capability_flags": 128,
    "manufacturer_code": 4742,
    "maximum_buffer_size": 66,
    "maximum_incoming_transfer_size": 66,
    "server_mask": 10752,
    "maximum_outgoing_transfer_size": 66,
    "descriptor_capability_field": 0
  },
  "endpoints": {
    "1": {
      "profile_id": "0x0104",
      "device_type": "0x0402",
      "input_clusters": [
        "0x0000",
        "0x0001",
        "0x0003",
        "0x0400",
        "0x0500",
        "0xef00"
      ],
      "output_clusters": []
    }
  },
  "manufacturer": "_TZE200_pay2byax",
  "model": "TS0601",
  "class": "zigpy.quirks.v2.CustomDeviceV2"
}
```

</details>


### Diagnostic information

<details><summary>Diagnostic information</summary>

```json
[Paste the diagnostic information here]
```

</details>


### Logs

<details><summary>Logs</summary>

```python
[Paste the logs here]
```

</details>


### Custom quirk

<details><summary>Custom quirk</summary>

```python
[Paste your custom quirk here]
```

</details>


### Additional information

The device has been mentioned before here: https://github.com/zigpy/zha-device-handlers/issues/1502

Entity sensor.tze200_pay2byax_ts0601_illuminance_2 (<class 'homeassistant.components.zha.sensor.Sensor'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('illuminance') it is using; expected one of ['lx'];

Pull request:
Add `BatterySize` enum
## Proposed change
<!--
  Explain your proposed change below.
-->

Sets correct battery size and voltage for `_TZE200_pay2byax TS0601`

Fixes #3713
## Additional information
<!--
  Please include any additional information that is important to this PR.
  For example, if this PR is a potentially breaking change, mention that here.
  If this PR requires other PRs to be merged in HA Core or other projects, mention that.
  Lastly, if this PR fixes a specific issue, please include "Fixes #xxxx".
-->


## Checklist
<!--
  Put an 'x' in all boxes that apply.
  Note: You do not need to tick all boxes before creating a PR.
-->

- [x] The changes are tested and work correctly
- [ ] `pre-commit` checks pass / the code has been formatted using Black
- [ ] Tests have been added to verify that the new code works


Patch:
diff --git a/pyproject.toml b/pyproject.toml
index ccd15c2..6636cb6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,7 +14,7 @@ readme = "README.md"
 license = {text = "Apache-2.0"}
 requires-python = ">=3.12"
 dependencies = [
-    "zigpy>=0.75.0",
+    "zigpy>=0.75.1",
 ]
 
 [tool.setuptools.packages.find]
diff --git a/zhaquirks/const.py b/zhaquirks/const.py
index 16d8763..5d0d814 100644
--- a/zhaquirks/const.py
+++ b/zhaquirks/const.py
@@ -12,6 +12,7 @@ from zigpy.quirks import (
     SIG_NODE_DESC,
     SIG_SKIP_CONFIG,
 )
+import zigpy.types as t
 
 ARGS = "args"
 ATTR_ID = "attr_id"
@@ -125,3 +126,21 @@ ZONE_STATUS_CHANGE_COMMAND = 0x0000
 ZONE_STATE = 0x0000
 ZONE_TYPE = 0x0001
 ZONE_STATUS = 0x0002
+
+
+class BatterySize(t.enum8):
+    """Battery sizes."""
+
+    No_battery = 0x00
+    Built_in = 0x01
+    Other = 0x02
+    AA = 0x03
+    AAA = 0x04
+    C = 0x05
+    D = 0x06
+    CR2 = 0x07
+    CR123A = 0x08
+    CR2450 = 0x09
+    CR2032 = 0x0A
+    CR1632 = 0x0B
+    Unknown = 0xFF
diff --git a/zhaquirks/ikea/__init__.py b/zhaquirks/ikea/__init__.py
index d584269..5d3a80f 100644
--- a/zhaquirks/ikea/__init__.py
+++ b/zhaquirks/ikea/__init__.py
@@ -8,6 +8,7 @@ from zigpy.zcl import foundation
 from zigpy.zcl.clusters.general import Basic, PowerConfiguration, Scenes
 
 from zhaquirks import EventableCluster
+from zhaquirks.const import BatterySize
 
 _LOGGER = logging.getLogger(__name__)
 
@@ -148,7 +149,7 @@ class PowerConfig1AAACluster(CustomCluster, PowerConfiguration):
     """Updating power attributes: 2 AAA."""
 
     _CONSTANT_ATTRIBUTES = {
-        BATTERY_SIZE: 4,
+        BATTERY_SIZE: BatterySize.AAA,
         BATTERY_QUANTITY: 1,
         BATTERY_RATED_VOLTAGE: 15,
     }
@@ -158,7 +159,7 @@ class PowerConfig2AAACluster(CustomCluster, PowerConfiguration):
     """Updating power attributes: 2 AAA."""
 
     _CONSTANT_ATTRIBUTES = {
-        BATTERY_SIZE: 4,
+        BATTERY_SIZE: BatterySize.AAA,
         BATTERY_QUANTITY: 2,
         BATTERY_RATED_VOLTAGE: 15,
     }
@@ -168,7 +169,7 @@ class PowerConfig2CRCluster(CustomCluster, PowerConfiguration):
     """Updating power attributes: 2 CR2032."""
 
     _CONSTANT_ATTRIBUTES = {
-        BATTERY_SIZE: 10,
+        BATTERY_SIZE: BatterySize.CR2032,
         BATTERY_QUANTITY: 2,
         BATTERY_RATED_VOLTAGE: 30,
     }
@@ -178,7 +179,7 @@ class PowerConfig1CRCluster(CustomCluster, PowerConfiguration):
     """Updating power attributes: 1 CR2032."""
 
     _CONSTANT_ATTRIBUTES = {
-        BATTERY_SIZE: 10,
+        BATTERY_SIZE: BatterySize.CR2032,
         BATTERY_QUANTITY: 1,
         BATTERY_RATED_VOLTAGE: 30,
     }
@@ -189,7 +190,7 @@ class PowerConfig1CRXCluster(CustomCluster, PowerConfiguration):
 
     _CONSTANT_ATTRIBUTES = {
         BATTERY_VOLTAGE: 0,
-        BATTERY_SIZE: 10,
+        BATTERY_SIZE: BatterySize.CR2032,
         BATTERY_QUANTITY: 1,
         BATTERY_RATED_VOLTAGE: 30,
     }
diff --git a/zhaquirks/tuya/__init__.py b/zhaquirks/tuya/__init__.py
index f380f3e..9b2b32c 100644
--- a/zhaquirks/tuya/__init__.py
+++ b/zhaquirks/tuya/__init__.py
@@ -11,13 +11,7 @@ from zigpy.quirks import BaseCustomDevice, CustomCluster, CustomDevice
 import zigpy.types as t
 from zigpy.zcl import BaseAttributeDefs, foundation
 from zigpy.zcl.clusters.closures import WindowCovering
-from zigpy.zcl.clusters.general import (
-    Basic,
-    BatterySize,
-    LevelControl,
-    OnOff,
-    PowerConfiguration,
-)
+from zigpy.zcl.clusters.general import Basic, LevelControl, OnOff, PowerConfiguration
 from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
 from zigpy.zcl.clusters.hvac import Thermostat, UserInterface
 from zigpy.zcl.clusters.smartenergy import Metering
@@ -30,6 +24,7 @@ from zhaquirks.const import (
     RIGHT,
     SHORT_PRESS,
     ZHA_SEND_EVENT,
+    BatterySize,
 )
 
 # ---------------------------------------------------------
diff --git a/zhaquirks/tuya/builder/__init__.py b/zhaquirks/tuya/builder/__init__.py
index 4d1310d..c8a92b8 100644
--- a/zhaquirks/tuya/builder/__init__.py
+++ b/zhaquirks/tuya/builder/__init__.py
@@ -17,7 +17,6 @@ from zigpy.quirks.v2.homeassistant.number import NumberDeviceClass
 from zigpy.quirks.v2.homeassistant.sensor import SensorDeviceClass, SensorStateClass
 import zigpy.types as t
 from zigpy.zcl import foundation
-from zigpy.zcl.clusters.general import BatterySize
 from zigpy.zcl.clusters.measurement import (
     PM25,
     CarbonDioxideConcentration,
@@ -31,6 +30,7 @@ from zigpy.zcl.clusters.security import IasZone
 from zigpy.zcl.clusters.smartenergy import Metering
 from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef
 
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya import (
     TUYA_CLUSTER_ID,
     BaseEnchantedDevice,
@@ -54,6 +54,9 @@ BATTERY_VOLTAGES = {
     BatterySize.AA: 15,
     BatterySize.CR2: 30,
     BatterySize.CR123A: 30,
+    BatterySize.CR2450: 30,
+    BatterySize.CR2032: 30,
+    BatterySize.CR1632: 30,
     BatterySize.Unknown: None,
 }
 
diff --git a/zhaquirks/tuya/tuya_gas.py b/zhaquirks/tuya/tuya_gas.py
index 2b30a95..0feeb8a 100644
--- a/zhaquirks/tuya/tuya_gas.py
+++ b/zhaquirks/tuya/tuya_gas.py
@@ -4,9 +4,9 @@ from zigpy.quirks.v2 import BinarySensorDeviceClass, EntityPlatform, EntityType
 from zigpy.quirks.v2.homeassistant import CONCENTRATION_PARTS_PER_MILLION, UnitOfTime
 from zigpy.quirks.v2.homeassistant.sensor import SensorDeviceClass, SensorStateClass
 import zigpy.types as t
-from zigpy.zcl.clusters.general import BatterySize
 from zigpy.zcl.clusters.security import IasZone
 
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya import TuyaLocalCluster
 from zhaquirks.tuya.builder import TuyaQuirkBuilder
 
diff --git a/zhaquirks/tuya/tuya_sensor.py b/zhaquirks/tuya/tuya_sensor.py
index 1a97b4b..767f29b 100644
--- a/zhaquirks/tuya/tuya_sensor.py
+++ b/zhaquirks/tuya/tuya_sensor.py
@@ -8,6 +8,7 @@ from zigpy.quirks.v2.homeassistant.sensor import SensorDeviceClass
 import zigpy.types as t
 from zigpy.zcl import foundation
 
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya import (
     TUYA_SET_TIME,
     TuyaPowerConfigurationCluster2AAA,
@@ -305,7 +306,7 @@ class NoManufTimeTuyaMCUCluster(TuyaMCUCluster):
     .applies_to("_TZE200_n8dljorx", "TS0601")
     .tuya_illuminance(dp_id=101)
     .tuya_contact(dp_id=1)
-    .tuya_battery(dp_id=2)
+    .tuya_battery(dp_id=2, battery_type=BatterySize.CR2032, battery_qty=1)
     .skip_configuration()
     .add_to_registry()
 )
diff --git a/zhaquirks/tuya/tuya_siren.py b/zhaquirks/tuya/tuya_siren.py
index f4246d7..319092e 100644
--- a/zhaquirks/tuya/tuya_siren.py
+++ b/zhaquirks/tuya/tuya_siren.py
@@ -4,8 +4,8 @@ from zigpy.quirks.v2 import EntityPlatform, EntityType
 from zigpy.quirks.v2.homeassistant import PERCENTAGE, UnitOfTemperature, UnitOfTime
 from zigpy.quirks.v2.homeassistant.binary_sensor import BinarySensorDeviceClass
 import zigpy.types as t
-from zigpy.zcl.clusters.general import BatterySize
 
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya.builder import TuyaQuirkBuilder
 
 
diff --git a/zhaquirks/tuya/tuya_valve.py b/zhaquirks/tuya/tuya_valve.py
index 96b2f1f..e036496 100644
--- a/zhaquirks/tuya/tuya_valve.py
+++ b/zhaquirks/tuya/tuya_valve.py
@@ -6,9 +6,9 @@ from zigpy.quirks.v2 import EntityPlatform, EntityType
 from zigpy.quirks.v2.homeassistant import UnitOfTime, UnitOfVolume
 from zigpy.quirks.v2.homeassistant.sensor import SensorDeviceClass, SensorStateClass
 import zigpy.types as t
-from zigpy.zcl.clusters.general import BatterySize
 from zigpy.zcl.clusters.smartenergy import Metering
 
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya import TUYA_CLUSTER_ID
 from zhaquirks.tuya.builder import TuyaQuirkBuilder, TuyaValveWaterConsumed
 from zhaquirks.tuya.mcu import TuyaMCUCluster
diff --git a/zhaquirks/xiaomi/__init__.py b/zhaquirks/xiaomi/__init__.py
index f07243e..4d2f536 100644
--- a/zhaquirks/xiaomi/__init__.py
+++ b/zhaquirks/xiaomi/__init__.py
@@ -48,6 +48,7 @@ from zhaquirks.const import (
     UNKNOWN,
     VALUE,
     ZHA_SEND_EVENT,
+    BatterySize,
 )
 
 BATTERY_LEVEL = "battery_level"
@@ -116,7 +117,7 @@ class XiaomiCustomDevice(CustomDevice):
     def __init__(self, *args, **kwargs):
         """Init."""
         if not hasattr(self, BATTERY_SIZE):
-            self.battery_size = 10
+            self.battery_size = BatterySize.CR2032
         super().__init__(*args, **kwargs)
 
 
@@ -507,7 +508,9 @@ class XiaomiPowerConfiguration(PowerConfiguration, LocalDataCluster):
         super().__init__(*args, **kwargs)
         self._CONSTANT_ATTRIBUTES = {
             BATTERY_QUANTITY_ATTR: 1,
-            BATTERY_SIZE_ATTR: getattr(self.endpoint.device, BATTERY_SIZE, 0xFF),
+            BATTERY_SIZE_ATTR: getattr(
+                self.endpoint.device, BATTERY_SIZE, BatterySize.Unknown
+            ),
         }
         self._slope = 200 / (self.MAX_VOLTS_MV - self.MIN_VOLTS_MV)
 
diff --git a/zhaquirks/xiaomi/aqara/cube.py b/zhaquirks/xiaomi/aqara/cube.py
index c73709e..4e782ae 100644
--- a/zhaquirks/xiaomi/aqara/cube.py
+++ b/zhaquirks/xiaomi/aqara/cube.py
@@ -26,6 +26,7 @@ from zhaquirks.const import (
     TURN_ON,
     VALUE,
     ZHA_SEND_EVENT,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -161,7 +162,7 @@ class Cube(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         super().__init__(*args, **kwargs)
 
     class MultistateInputCluster(CustomCluster, MultistateInput):
diff --git a/zhaquirks/xiaomi/aqara/cube_aqgl01.py b/zhaquirks/xiaomi/aqara/cube_aqgl01.py
index d5efbec..f5cdfcb 100644
--- a/zhaquirks/xiaomi/aqara/cube_aqgl01.py
+++ b/zhaquirks/xiaomi/aqara/cube_aqgl01.py
@@ -27,6 +27,7 @@ from zhaquirks.const import (
     TURN_ON,
     VALUE,
     ZHA_SEND_EVENT,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -214,7 +215,7 @@ class CubeAQGL01(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         super().__init__(*args, **kwargs)
 
     signature = {
@@ -353,7 +354,7 @@ class CubeCAGL02(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/aqara/magnet_ac01.py b/zhaquirks/xiaomi/aqara/magnet_ac01.py
index 1a9f67d..3edbe41 100644
--- a/zhaquirks/xiaomi/aqara/magnet_ac01.py
+++ b/zhaquirks/xiaomi/aqara/magnet_ac01.py
@@ -12,6 +12,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -42,7 +43,7 @@ class LumiMagnetAC01(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 8
+        self.battery_size = BatterySize.CR123A
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/aqara/magnet_acn001.py b/zhaquirks/xiaomi/aqara/magnet_acn001.py
index 5304499..415de2f 100644
--- a/zhaquirks/xiaomi/aqara/magnet_acn001.py
+++ b/zhaquirks/xiaomi/aqara/magnet_acn001.py
@@ -11,6 +11,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -28,7 +29,7 @@ class MagnetE1(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/aqara/magnet_agl02.py b/zhaquirks/xiaomi/aqara/magnet_agl02.py
index 2a63c40..e6d4f96 100644
--- a/zhaquirks/xiaomi/aqara/magnet_agl02.py
+++ b/zhaquirks/xiaomi/aqara/magnet_agl02.py
@@ -11,6 +11,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     BasicCluster,
@@ -25,7 +26,7 @@ class MagnetT1(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/aqara/magnet_aq2.py b/zhaquirks/xiaomi/aqara/magnet_aq2.py
index f59f8c8..20066b7 100644
--- a/zhaquirks/xiaomi/aqara/magnet_aq2.py
+++ b/zhaquirks/xiaomi/aqara/magnet_aq2.py
@@ -12,6 +12,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -31,7 +32,7 @@ class MagnetAQ2(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/aqara/motion_ac02.py b/zhaquirks/xiaomi/aqara/motion_ac02.py
index 58da99a..d6c2145 100644
--- a/zhaquirks/xiaomi/aqara/motion_ac02.py
+++ b/zhaquirks/xiaomi/aqara/motion_ac02.py
@@ -18,6 +18,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LocalIlluminanceMeasurementCluster,
@@ -91,7 +92,7 @@ class LumiMotionAC02(CustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         self.battery_quantity = 2
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
diff --git a/zhaquirks/xiaomi/aqara/motion_acn001.py b/zhaquirks/xiaomi/aqara/motion_acn001.py
index 138f705..189957c 100644
--- a/zhaquirks/xiaomi/aqara/motion_acn001.py
+++ b/zhaquirks/xiaomi/aqara/motion_acn001.py
@@ -11,6 +11,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -30,7 +31,7 @@ class MotionE1(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
 
diff --git a/zhaquirks/xiaomi/aqara/motion_agl02.py b/zhaquirks/xiaomi/aqara/motion_agl02.py
index aa7d0fa..6ad286c 100644
--- a/zhaquirks/xiaomi/aqara/motion_agl02.py
+++ b/zhaquirks/xiaomi/aqara/motion_agl02.py
@@ -14,6 +14,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -32,7 +33,7 @@ class MotionT1(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
 
diff --git a/zhaquirks/xiaomi/aqara/motion_agl04.py b/zhaquirks/xiaomi/aqara/motion_agl04.py
index 846bb7e..19e19c3 100644
--- a/zhaquirks/xiaomi/aqara/motion_agl04.py
+++ b/zhaquirks/xiaomi/aqara/motion_agl04.py
@@ -17,6 +17,7 @@ from zhaquirks.const import (
     MODELS_INFO,
     OUTPUT_CLUSTERS,
     PROFILE_ID,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     DeviceTemperatureCluster,
@@ -64,7 +65,7 @@ class LumiLumiMotionAgl04(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         self.battery_quantity = 2
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
diff --git a/zhaquirks/xiaomi/aqara/motion_aq2.py b/zhaquirks/xiaomi/aqara/motion_aq2.py
index e3647cc..319158f 100644
--- a/zhaquirks/xiaomi/aqara/motion_aq2.py
+++ b/zhaquirks/xiaomi/aqara/motion_aq2.py
@@ -15,6 +15,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -36,7 +37,7 @@ class MotionAQ2(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
 
diff --git a/zhaquirks/xiaomi/aqara/motion_aq2b.py b/zhaquirks/xiaomi/aqara/motion_aq2b.py
index 212b896..fd07fe8 100644
--- a/zhaquirks/xiaomi/aqara/motion_aq2b.py
+++ b/zhaquirks/xiaomi/aqara/motion_aq2b.py
@@ -13,6 +13,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -32,7 +33,7 @@ class MotionAQ2(XiaomiCustomDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
 
diff --git a/zhaquirks/xiaomi/mija/motion.py b/zhaquirks/xiaomi/mija/motion.py
index 15b2d4c..fdb1685 100644
--- a/zhaquirks/xiaomi/mija/motion.py
+++ b/zhaquirks/xiaomi/mija/motion.py
@@ -21,6 +21,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -40,7 +41,7 @@ class Motion(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 9
+        self.battery_size = BatterySize.CR2450
         self.motion_bus = Bus()
         super().__init__(*args, **kwargs)
 
diff --git a/zhaquirks/xiaomi/mija/sensor_magnet.py b/zhaquirks/xiaomi/mija/sensor_magnet.py
index 7413f13..72b34cc 100644
--- a/zhaquirks/xiaomi/mija/sensor_magnet.py
+++ b/zhaquirks/xiaomi/mija/sensor_magnet.py
@@ -19,6 +19,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -38,7 +39,7 @@ class Magnet(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 11
+        self.battery_size = BatterySize.CR1632
         super().__init__(*args, **kwargs)
 
     signature = {
diff --git a/zhaquirks/xiaomi/mija/sensor_switch.py b/zhaquirks/xiaomi/mija/sensor_switch.py
index 3ab9e56..1fa2285 100644
--- a/zhaquirks/xiaomi/mija/sensor_switch.py
+++ b/zhaquirks/xiaomi/mija/sensor_switch.py
@@ -44,6 +44,7 @@ from zhaquirks.const import (
     TRIPLE_PRESS,
     UNKNOWN,
     ZHA_SEND_EVENT,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -68,7 +69,7 @@ class MijaButton(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init."""
-        self.battery_size = 10
+        self.battery_size = BatterySize.CR2032
         super().__init__(*args, **kwargs)
 
     class MijaOnOff(CustomCluster, OnOff):
diff --git a/zhaquirks/xiaomi/mija/smoke.py b/zhaquirks/xiaomi/mija/smoke.py
index d2780a2..d4a4b44 100644
--- a/zhaquirks/xiaomi/mija/smoke.py
+++ b/zhaquirks/xiaomi/mija/smoke.py
@@ -34,6 +34,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     SKIP_CONFIGURATION,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -66,7 +67,7 @@ class MijiaHoneywellSmokeDetectorSensor(XiaomiQuickInitDevice):
 
     def __init__(self, *args, **kwargs):
         """Init method."""
-        self.battery_size = 8  # CR123a
+        self.battery_size = BatterySize.CR123A
         super().__init__(*args, **kwargs)
 
     signature = {


Test patch:
diff --git a/requirements_test.txt b/requirements_test.txt
index 7cef89a..61cd54f 100644
--- a/requirements_test.txt
+++ b/requirements_test.txt
@@ -13,5 +13,5 @@ pytest-sugar
 pytest-timeout
 pytest-asyncio
 pytest>=7.1.3
-zigpy>=0.75.0
+zigpy>=0.75.1
 ruff==0.0.261
diff --git a/tests/test_tuya_builder.py b/tests/test_tuya_builder.py
index 425c7ac..10ad800 100644
--- a/tests/test_tuya_builder.py
+++ b/tests/test_tuya_builder.py
@@ -8,10 +8,11 @@ from zigpy.quirks.registry import DeviceRegistry
 from zigpy.quirks.v2 import CustomDeviceV2
 import zigpy.types as t
 from zigpy.zcl import foundation
-from zigpy.zcl.clusters.general import Basic, BatterySize
+from zigpy.zcl.clusters.general import Basic
 
 from tests.common import ClusterListener, MockDatetime, wait_for_zigpy_tasks
 import zhaquirks
+from zhaquirks.const import BatterySize
 from zhaquirks.tuya import (
     TUYA_QUERY_DATA,
     TUYA_SET_TIME,
@@ -93,6 +94,9 @@ async def test_convenience_methods(device_mock, method_name, attr_name, exp_clas
         (TuyaPowerConfigurationCluster2AAA, None, None, None, BatterySize.AAA, 2, 15),
         (None, BatterySize.CR123A, 1, 60, BatterySize.CR123A, 1, 60),
         (None, BatterySize.CR123A, 1, None, BatterySize.CR123A, 1, 30),
+        (None, BatterySize.CR2450, 1, None, BatterySize.CR2450, 1, 30),
+        (None, BatterySize.CR2032, 1, None, BatterySize.CR2032, 1, 30),
+        (None, BatterySize.CR1632, 1, None, BatterySize.CR1632, 1, 30),
         (None, BatterySize.AA, None, None, BatterySize.AA, None, None),
         (None, None, None, None, None, None, None),
     ],
diff --git a/tests/test_xiaomi.py b/tests/test_xiaomi.py
index a6f4454..fb6a452 100644
--- a/tests/test_xiaomi.py
+++ b/tests/test_xiaomi.py
@@ -47,6 +47,7 @@ from zhaquirks.const import (
     OUTPUT_CLUSTERS,
     PROFILE_ID,
     ZONE_STATUS_CHANGE_COMMAND,
+    BatterySize,
 )
 from zhaquirks.xiaomi import (
     LUMI,
@@ -58,6 +59,8 @@ from zhaquirks.xiaomi import (
     XiaomiQuickInitDevice,
     handle_quick_init,
 )
+import zhaquirks.xiaomi.aqara.cube
+import zhaquirks.xiaomi.aqara.cube_aqgl01
 import zhaquirks.xiaomi.aqara.driver_curtain_e1
 from zhaquirks.xiaomi.aqara.feeder_acn001 import (
     FEEDER_ATTR,
@@ -75,9 +78,14 @@ from zhaquirks.xiaomi.aqara.feeder_acn001 import (
     AqaraFeederAcn001,
     OppleCluster,
 )
+import zhaquirks.xiaomi.aqara.magnet_ac01
+import zhaquirks.xiaomi.aqara.magnet_acn001
 import zhaquirks.xiaomi.aqara.magnet_agl02
+import zhaquirks.xiaomi.aqara.magnet_aq2
 import zhaquirks.xiaomi.aqara.motion_ac02
+import zhaquirks.xiaomi.aqara.motion_acn001
 import zhaquirks.xiaomi.aqara.motion_agl02
+import zhaquirks.xiaomi.aqara.motion_agl04
 import zhaquirks.xiaomi.aqara.motion_aq2
 import zhaquirks.xiaomi.aqara.motion_aq2b
 import zhaquirks.xiaomi.aqara.plug
@@ -89,6 +97,7 @@ import zhaquirks.xiaomi.aqara.switch_t1
 from zhaquirks.xiaomi.aqara.thermostat_agl001 import ScheduleEvent, ScheduleSettings
 import zhaquirks.xiaomi.aqara.weather
 import zhaquirks.xiaomi.mija.motion
+import zhaquirks.xiaomi.mija.smoke
 
 zhaquirks.setup()
 
@@ -384,10 +393,27 @@ async def test_mija_battery(zigpy_device_from_quirk, voltage, bpr):
 @pytest.mark.parametrize(
     "quirk, batt_size",
     (
-        (zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1, 0x0A),
-        (zhaquirks.xiaomi.mija.motion.Motion, 0x09),
-        (zhaquirks.xiaomi.mija.sensor_switch.MijaButton, 0x0A),
-        (zhaquirks.xiaomi.mija.sensor_magnet.Magnet, 0x0B),
+        (zhaquirks.xiaomi.aqara.vibration_aq1.VibrationAQ1, BatterySize.CR2032),
+        (zhaquirks.xiaomi.aqara.cube.Cube, BatterySize.CR2450),
+        (zhaquirks.xiaomi.aqara.cube_aqgl01.CubeAQGL01, BatterySize.CR2450),
+        (zhaquirks.xiaomi.aqara.cube_aqgl01.CubeCAGL02, BatterySize.CR2450),
+        (zhaquirks.xiaomi.aqara.magnet_ac01.LumiMagnetAC01, BatterySize.CR123A),
+        (zhaquirks.xiaomi.aqara.magnet_acn001.MagnetE1, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.magnet_agl02.MagnetT1, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.magnet_aq2.MagnetAQ2, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.motion_ac02.LumiMotionAC02, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.motion_acn001.MotionE1, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.motion_agl02.MotionT1, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.motion_agl04.LumiLumiMotionAgl04, BatterySize.CR1632),
+        (zhaquirks.xiaomi.aqara.motion_aq2.MotionAQ2, BatterySize.CR2450),
+        (zhaquirks.xiaomi.aqara.motion_aq2b.MotionAQ2, BatterySize.CR2450),
+        (zhaquirks.xiaomi.mija.motion.Motion, BatterySize.CR2450),
+        (zhaquirks.xiaomi.mija.sensor_switch.MijaButton, BatterySize.CR2032),
+        (zhaquirks.xiaomi.mija.sensor_magnet.Magnet, BatterySize.CR1632),
+        (
+            zhaquirks.xiaomi.mija.smoke.MijiaHoneywellSmokeDetectorSensor,
+            BatterySize.CR123A,
+        ),
     ),
 )
 async def test_xiaomi_batt_size(zigpy_device_from_quirk, quirk, batt_size):