mirror of
https://github.com/home-assistant/core.git
synced 2026-09-24 15:31:52 -05:00
Add number platform to Tuya qccdz (EV charger) (#181641)
This commit is contained in:
@@ -641,6 +641,7 @@ class DPCode(StrEnum):
|
||||
CH2O_VALUE = "ch2o_value"
|
||||
CH4_SENSOR_STATE = "ch4_sensor_state"
|
||||
CH4_SENSOR_VALUE = "ch4_sensor_value"
|
||||
CHARGE_CUR_SET = "charge_cur_set"
|
||||
CHARGE_STATE = "charge_state"
|
||||
CHILD_LOCK = "child_lock" # Child lock
|
||||
CISTERN = "cistern"
|
||||
|
||||
@@ -226,6 +226,13 @@ NUMBERS: dict[DeviceCategory, tuple[NumberEntityDescription, ...]] = {
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
),
|
||||
DeviceCategory.QCCDZ: (
|
||||
NumberEntityDescription(
|
||||
key=DPCode.CHARGE_CUR_SET,
|
||||
translation_key="charging_current",
|
||||
device_class=NumberDeviceClass.CURRENT,
|
||||
),
|
||||
),
|
||||
DeviceCategory.SWTZ: (
|
||||
NumberEntityDescription(
|
||||
key=DPCode.COOK_TEMPERATURE,
|
||||
|
||||
@@ -190,6 +190,9 @@
|
||||
"battery_backup_reserve": {
|
||||
"name": "Battery backup reserve"
|
||||
},
|
||||
"charging_current": {
|
||||
"name": "Charging current"
|
||||
},
|
||||
"cloud_recipe": {
|
||||
"name": "Cloud recipe"
|
||||
},
|
||||
|
||||
@@ -785,6 +785,67 @@
|
||||
'state': '1.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[number.ev_charger_charging_current-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
<NumberEntityCapabilityAttribute.MAX: 'max'>: 255.0,
|
||||
<NumberEntityCapabilityAttribute.MIN: 'min'>: 1.0,
|
||||
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
|
||||
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'number',
|
||||
'entity_category': None,
|
||||
'entity_id': 'number.ev_charger_charging_current',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'object_id_base': 'Charging current',
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <NumberDeviceClass.CURRENT: 'current'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Charging current',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'charging_current',
|
||||
'unique_id': 'tuya.lr7th3bpx7masmsdzdccqcharge_cur_set',
|
||||
'unit_of_measurement': 'A',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[number.ev_charger_charging_current-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'current',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'EV Charger Charging current',
|
||||
<NumberEntityCapabilityAttribute.MAX: 'max'>: 255.0,
|
||||
<NumberEntityCapabilityAttribute.MIN: 'min'>: 1.0,
|
||||
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
|
||||
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'A',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.ev_charger_charging_current',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '10.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[number.garden_valve_yard_irrigation_duration-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': list([
|
||||
|
||||
Reference in New Issue
Block a user