1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-02 08:26:41 +01:00

Add binary sensor support for Tuya WG2 alarm panel (Duosmart C30) (#165833)

This commit is contained in:
Carlos Sánchez López
2026-03-17 14:41:57 -06:00
committed by GitHub
parent c8ce4eb32d
commit ddab50edcc
3 changed files with 57 additions and 1 deletions

View File

@@ -317,6 +317,11 @@ BINARY_SENSORS: dict[DeviceCategory, tuple[TuyaBinarySensorEntityDescription, ..
entity_category=EntityCategory.DIAGNOSTIC,
on_value="alarm",
),
TuyaBinarySensorEntityDescription(
key=DPCode.CHARGE_STATE,
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
entity_category=EntityCategory.DIAGNOSTIC,
),
),
DeviceCategory.WK: (
TuyaBinarySensorEntityDescription(

View File

@@ -101,6 +101,57 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.c30_charging-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.c30_charging',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Charging',
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.BATTERY_CHARGING: 'battery_charging'>,
'original_icon': None,
'original_name': 'Charging',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'tuya.rirsc4vhpbv2whkp2gwcharge_state',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.c30_charging-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery_charging',
'friendly_name': 'C30 Charging',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.c30_charging',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.cat_feeder_feeding-entry]
EntityRegistryEntrySnapshot({
'aliases': list([

View File

@@ -7150,7 +7150,7 @@
'labels': set({
}),
'manufacturer': 'Tuya',
'model': 'C30 (unsupported)',
'model': 'C30',
'model_id': 'pkhw2vbphv4csrir',
'name': 'C30',
'name_by_user': None,