diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 49a34db9064e3e..6062845c8fa0a8 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -639,6 +639,8 @@ 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" # Charging current setpoint + CHARGE_ENERGY_ONCE = "charge_energy_once" # Energy of the current charging session CHARGE_STATE = "charge_state" CHILD_LOCK = "child_lock" # Child lock CISTERN = "cistern" @@ -856,6 +858,7 @@ class DPCode(StrEnum): SENSOR_TEMPERATURE = "sensor_temperature" SHAKE = "shake" # Oscillating SHOCK_STATE = "shock_state" # Vibration status + SIGLE_PHASE_POWER = "sigle_phase_power" # Single-phase power (Tuya's spelling) SIREN_SWITCH = "siren_switch" SITUATION_SET = "situation_set" SLEEP = "sleep" # Sleep function diff --git a/homeassistant/components/tuya/number.py b/homeassistant/components/tuya/number.py index 150c0138f0d1fc..e16e4a622dc820 100644 --- a/homeassistant/components/tuya/number.py +++ b/homeassistant/components/tuya/number.py @@ -226,6 +226,13 @@ 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, diff --git a/homeassistant/components/tuya/select.py b/homeassistant/components/tuya/select.py index 99e0da47c69df4..d37aebd6a66873 100644 --- a/homeassistant/components/tuya/select.py +++ b/homeassistant/components/tuya/select.py @@ -190,6 +190,12 @@ translation_key="countdown", ), ), + DeviceCategory.QCCDZ: ( + SelectEntityDescription( + key=DPCode.WORK_MODE, + translation_key="charger_work_mode", + ), + ), DeviceCategory.QN: ( SelectEntityDescription( key=DPCode.LEVEL, diff --git a/homeassistant/components/tuya/sensor.py b/homeassistant/components/tuya/sensor.py index b0638c10428c84..9a468d7b7c6eb5 100644 --- a/homeassistant/components/tuya/sensor.py +++ b/homeassistant/components/tuya/sensor.py @@ -855,6 +855,43 @@ class TuyaSensorEntityDescription(SensorEntityDescription): ), *BATTERY_SENSORS, ), + DeviceCategory.QCCDZ: ( + TuyaSensorEntityDescription( + key=DPCode.WORK_STATE, + translation_key="charger_status", + ), + TuyaSensorEntityDescription( + key=DPCode.FORWARD_ENERGY_TOTAL, + translation_key="total_energy", + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + TuyaSensorEntityDescription( + key=DPCode.CHARGE_ENERGY_ONCE, + translation_key="session_energy", + device_class=SensorDeviceClass.ENERGY, + state_class=SensorStateClass.TOTAL_INCREASING, + ), + TuyaSensorEntityDescription( + key=DPCode.SIGLE_PHASE_POWER, + translation_key="single_phase_power", + device_class=SensorDeviceClass.POWER, + state_class=SensorStateClass.MEASUREMENT, + ), + TuyaSensorEntityDescription( + key=DPCode.POWER_TOTAL, + translation_key="total_power", + device_class=SensorDeviceClass.POWER, + state_class=SensorStateClass.MEASUREMENT, + ), + TuyaSensorEntityDescription( + key=DPCode.TEMP_CURRENT, + translation_key="temperature", + device_class=SensorDeviceClass.TEMPERATURE, + state_class=SensorStateClass.MEASUREMENT, + entity_category=EntityCategory.DIAGNOSTIC, + ), + ), DeviceCategory.QN: ( TuyaSensorEntityDescription( key=DPCode.WORK_POWER, diff --git a/homeassistant/components/tuya/strings.json b/homeassistant/components/tuya/strings.json index 8676c8dc8b24d7..1fae40e723caf5 100644 --- a/homeassistant/components/tuya/strings.json +++ b/homeassistant/components/tuya/strings.json @@ -193,6 +193,9 @@ "battery_backup_reserve": { "name": "Battery backup reserve" }, + "charging_current": { + "name": "Charging current" + }, "cloud_recipe": { "name": "Cloud recipe" }, @@ -340,6 +343,15 @@ "brightness": { "name": "Brightness" }, + "charger_work_mode": { + "name": "Charging mode", + "state": { + "charge_energy": "Charge by energy", + "charge_now": "Charge now", + "charge_pct": "Charge to percentage", + "charge_schedule": "Scheduled" + } + }, "concentration": { "name": "Concentration" }, @@ -696,6 +708,19 @@ "cat_weight": { "name": "Cat weight" }, + "charger_status": { + "name": "Status", + "state": { + "charger_charging": "[%key:common::state::charging%]", + "charger_end": "Finished", + "charger_fault": "[%key:common::state::fault%]", + "charger_free": "[%key:common::state::idle%]", + "charger_free_fault": "Fault while idle", + "charger_insert": "Plugged in", + "charger_pause": "[%key:common::state::paused%]", + "charger_wait": "Waiting" + } + }, "cleaning_area": { "name": "Cleaning area" }, @@ -926,9 +951,15 @@ "rolling_brush_life": { "name": "Rolling brush lifetime" }, + "session_energy": { + "name": "Session energy" + }, "side_brush_life": { "name": "Side brush lifetime" }, + "single_phase_power": { + "name": "Single-phase power" + }, "smoke_amount": { "name": "Smoke amount" }, diff --git a/tests/components/tuya/fixtures/qccdz_dsmsam7xpb3ht7rl.json b/tests/components/tuya/fixtures/qccdz_dsmsam7xpb3ht7rl.json new file mode 100644 index 00000000000000..effa1abeffdb52 --- /dev/null +++ b/tests/components/tuya/fixtures/qccdz_dsmsam7xpb3ht7rl.json @@ -0,0 +1,157 @@ +{ + "endpoint": "https://apigw.tuyaeu.com", + "mqtt_connected": true, + "disabled_by": null, + "disabled_polling": false, + "name": "EV Charger", + "category": "qccdz", + "product_id": "dsmsam7xpb3ht7rl", + "product_name": "EV Charger", + "online": true, + "sub": false, + "time_zone": "+03:00", + "active_time": "2026-09-04T09:07:25+00:00", + "create_time": "2026-09-04T09:07:25+00:00", + "update_time": "2026-09-04T09:07:25+00:00", + "function": { + "charge_cur_set": { + "type": "Integer", + "value": { + "unit": "A", + "min": 1, + "max": 255, + "scale": 0, + "step": 1 + } + }, + "work_mode": { + "type": "Enum", + "value": { + "range": [ + "charge_now", + "charge_pct", + "charge_energy", + "charge_schedule" + ] + } + }, + "switch": { + "type": "Boolean", + "value": {} + } + }, + "status_range": { + "forward_energy_total": { + "type": "Integer", + "value": { + "unit": "kW·h", + "min": 0, + "max": 99999999, + "scale": 2, + "step": 1 + }, + "report_type": "minux" + }, + "work_state": { + "type": "Enum", + "value": { + "range": [ + "charger_free", + "charger_insert", + "charger_free_fault", + "charger_wait", + "charger_charging", + "charger_pause", + "charger_end", + "charger_fault" + ] + }, + "report_type": null + }, + "charge_cur_set": { + "type": "Integer", + "value": { + "unit": "A", + "min": 1, + "max": 255, + "scale": 0, + "step": 1 + }, + "report_type": null + }, + "sigle_phase_power": { + "type": "Integer", + "value": { + "unit": "kW", + "min": 0, + "max": 99999999, + "scale": 3, + "step": 1 + }, + "report_type": null + }, + "power_total": { + "type": "Integer", + "value": { + "unit": "kW", + "min": 0, + "max": 99999999, + "scale": 3, + "step": 1 + }, + "report_type": null + }, + "work_mode": { + "type": "Enum", + "value": { + "range": [ + "charge_now", + "charge_pct", + "charge_energy", + "charge_schedule" + ] + }, + "report_type": null + }, + "switch": { + "type": "Boolean", + "value": {}, + "report_type": null + }, + "temp_current": { + "type": "Integer", + "value": { + "unit": "℃", + "min": -40, + "max": 200, + "scale": 0, + "step": 1 + }, + "report_type": null + }, + "charge_energy_once": { + "type": "Integer", + "value": { + "unit": "kW·h", + "min": 0, + "max": 999999, + "scale": 2, + "step": 1 + }, + "report_type": null + } + }, + "status": { + "forward_energy_total": 20, + "work_state": "charger_free", + "charge_cur_set": 10, + "sigle_phase_power": 0, + "power_total": 0, + "work_mode": "charge_now", + "switch": false, + "temp_current": 24, + "charge_energy_once": 0 + }, + "set_up": true, + "support_local": true +} diff --git a/tests/components/tuya/snapshots/test_init.ambr b/tests/components/tuya/snapshots/test_init.ambr index 43f740196fe052..43925b8e1c10b2 100644 --- a/tests/components/tuya/snapshots/test_init.ambr +++ b/tests/components/tuya/snapshots/test_init.ambr @@ -5549,6 +5549,36 @@ 'via_device_id': None, }) # --- +# name: test_device_registry[lr7th3bpx7masmsdzdccq] + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entry_id': , + 'config_subentry_id': , + 'configuration_url': None, + 'connections': set({ + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'tuya', + 'lr7th3bpx7masmsdzdccq', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'Tuya', + 'model': 'EV Charger', + 'model_id': 'dsmsam7xpb3ht7rl', + 'name': 'EV Charger', + 'name_by_user': None, + 'serial_number': None, + 'sw_version': None, + 'via_device_id': None, + }) +# --- # name: test_device_registry[mgcpxpmovasazerdps] DeviceRegistryEntrySnapshot({ 'area_id': None, diff --git a/tests/components/tuya/snapshots/test_number.ambr b/tests/components/tuya/snapshots/test_number.ambr index be01c8d633d3e0..2ab761a8cb3db4 100644 --- a/tests/components/tuya/snapshots/test_number.ambr +++ b/tests/components/tuya/snapshots/test_number.ambr @@ -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({ + : 255.0, + : 1.0, + : , + : 1.0, + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + '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': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Charging current', + 'options': dict({ + }), + 'original_device_class': , + '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({ + : 'current', + : 'EV Charger Charging current', + : 255.0, + : 1.0, + : , + : 1.0, + : 'A', + }), + 'context': , + 'entity_id': 'number.ev_charger_charging_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '10.0', + }) +# --- # name: test_platform_setup_and_discovery[number.garden_valve_yard_irrigation_duration-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_select.ambr b/tests/components/tuya/snapshots/test_select.ambr index 3fe3d784b79356..471a03ecb6a4a3 100644 --- a/tests/components/tuya/snapshots/test_select.ambr +++ b/tests/components/tuya/snapshots/test_select.ambr @@ -243,6 +243,69 @@ 'state': 'power_on', }) # --- +# name: test_platform_setup_and_discovery[select.ac_charging_control_box_charging_mode-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'charge_now', + 'charge_pct', + 'charge_energy', + 'charge_schedule', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': None, + 'entity_id': 'select.ac_charging_control_box_charging_mode', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Charging mode', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Charging mode', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'charger_work_mode', + 'unique_id': 'tuya.qyy1auihjyoogvb7zdccqwork_mode', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[select.ac_charging_control_box_charging_mode-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'AC charging control box Charging mode', + : list([ + 'charge_now', + 'charge_pct', + 'charge_energy', + 'charge_schedule', + ]), + }), + 'context': , + 'entity_id': 'select.ac_charging_control_box_charging_mode', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'charge_now', + }) +# --- # name: test_platform_setup_and_discovery[select.aqi_volume-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -2862,6 +2925,69 @@ 'state': 'last', }) # --- +# name: test_platform_setup_and_discovery[select.ev_charger_charging_mode-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'charge_now', + 'charge_pct', + 'charge_energy', + 'charge_schedule', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': None, + 'entity_id': 'select.ev_charger_charging_mode', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Charging mode', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Charging mode', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'charger_work_mode', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqwork_mode', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[select.ev_charger_charging_mode-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'EV Charger Charging mode', + : list([ + 'charge_now', + 'charge_pct', + 'charge_energy', + 'charge_schedule', + ]), + }), + 'context': , + 'entity_id': 'select.ev_charger_charging_mode', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'charge_now', + }) +# --- # name: test_platform_setup_and_discovery[select.framboisier_indicator_light_mode-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_sensor.ambr b/tests/components/tuya/snapshots/test_sensor.ambr index 20bd10d7cbcb5b..a19d34cd2aa035 100644 --- a/tests/components/tuya/snapshots/test_sensor.ambr +++ b/tests/components/tuya/snapshots/test_sensor.ambr @@ -481,6 +481,136 @@ 'state': '239.6', }) # --- +# name: test_platform_setup_and_discovery[sensor.ac_charging_control_box_session_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ac_charging_control_box_session_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Session energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Session energy', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'session_energy', + 'unique_id': 'tuya.qyy1auihjyoogvb7zdccqcharge_energy_once', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ac_charging_control_box_session_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'energy', + : 'AC charging control box Session energy', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.ac_charging_control_box_session_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.01', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ac_charging_control_box_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'charger_free', + 'charger_insert', + 'charger_free_fault', + 'charger_wait', + 'charger_charging', + 'charger_pause', + 'charger_end', + 'charger_fault', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ac_charging_control_box_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Status', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Status', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'charger_status', + 'unique_id': 'tuya.qyy1auihjyoogvb7zdccqwork_state', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ac_charging_control_box_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'AC charging control box Status', + : list([ + 'charger_free', + 'charger_insert', + 'charger_free_fault', + 'charger_wait', + 'charger_charging', + 'charger_pause', + 'charger_end', + 'charger_fault', + ]), + }), + 'context': , + 'entity_id': 'sensor.ac_charging_control_box_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'charger_free', + }) +# --- # name: test_platform_setup_and_discovery[sensor.air_purifier_current-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -7859,6 +7989,368 @@ 'state': '237.7', }) # --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_session_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ev_charger_session_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Session energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Session energy', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'session_energy', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqcharge_energy_once', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_session_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'energy', + : 'EV Charger Session energy', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.ev_charger_session_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_single_phase_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ev_charger_single_phase_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Single-phase power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Single-phase power', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'single_phase_power', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqsigle_phase_power', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_single_phase_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : 'EV Charger Single-phase power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.ev_charger_single_phase_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_status-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : list([ + 'charger_free', + 'charger_insert', + 'charger_free_fault', + 'charger_wait', + 'charger_charging', + 'charger_pause', + 'charger_end', + 'charger_fault', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ev_charger_status', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Status', + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Status', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'charger_status', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqwork_state', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_status-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'enum', + : 'EV Charger Status', + : list([ + 'charger_free', + 'charger_insert', + 'charger_free_fault', + 'charger_wait', + 'charger_charging', + 'charger_pause', + 'charger_end', + 'charger_fault', + ]), + }), + 'context': , + 'entity_id': 'sensor.ev_charger_status', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'charger_free', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.ev_charger_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Temperature', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Temperature', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'temperature', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqtemp_current', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'temperature', + : 'EV Charger Temperature', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.ev_charger_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '24.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_total_energy-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ev_charger_total_energy', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Total energy', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Total energy', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'total_energy', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqforward_energy_total', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_total_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'energy', + : 'EV Charger Total energy', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.ev_charger_total_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.2', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_total_power-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': dict({ + : , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.ev_charger_total_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Total power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Total power', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'total_power', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqpower_total', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.ev_charger_total_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : 'EV Charger Total power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.ev_charger_total_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.fenetre_cuisine_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ diff --git a/tests/components/tuya/snapshots/test_switch.ambr b/tests/components/tuya/snapshots/test_switch.ambr index dd4813264bddc0..cc97cfc2463d1a 100644 --- a/tests/components/tuya/snapshots/test_switch.ambr +++ b/tests/components/tuya/snapshots/test_switch.ambr @@ -4235,6 +4235,56 @@ 'state': 'off', }) # --- +# name: test_platform_setup_and_discovery[switch.ev_charger_switch-entry] + EntityRegistryEntrySnapshot({ + 'aliases': list([ + None, + ]), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.ev_charger_switch', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Switch', + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Switch', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'switch', + 'unique_id': 'tuya.lr7th3bpx7masmsdzdccqswitch', + 'unit_of_measurement': None, + }) +# --- +# name: test_platform_setup_and_discovery[switch.ev_charger_switch-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'EV Charger Switch', + }), + 'context': , + 'entity_id': 'switch.ev_charger_switch', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_platform_setup_and_discovery[switch.fakkel_veranda_socket_1-entry] EntityRegistryEntrySnapshot({ 'aliases': list([