diff --git a/tests/components/tuya/fixtures/zndb_iow5ux77dxy3yrpj.json b/tests/components/tuya/fixtures/zndb_iow5ux77dxy3yrpj.json new file mode 100644 index 000000000000..d1210d9a5274 --- /dev/null +++ b/tests/components/tuya/fixtures/zndb_iow5ux77dxy3yrpj.json @@ -0,0 +1,129 @@ +{ + "endpoint": "https://apigw.tuyacn.com", + "mqtt_connected": true, + "disabled_by": null, + "disabled_polling": false, + "name": "三相电能表 2", + "category": "zndb", + "product_id": "iow5ux77dxy3yrpj", + "product_name": "Three Phase Energy Meter", + "online": true, + "sub": false, + "time_zone": "+8:00", + "active_time": "2026-09-02T09:53:06+00:00", + "create_time": "2026-09-02T09:53:06+00:00", + "update_time": "2026-09-02T09:53:06+00:00", + "function": { + "alarm_set_2": { + "code": "alarm_set_2", + "type": "Json", + "value": {} + }, + "clear": { + "code": "clear", + "type": "Boolean", + "value": {} + } + }, + "status_range": { + "forward_energy_total": { + "type": "Integer", + "value": { + "unit": "kW·h", + "min": 0, + "max": 99999999, + "scale": 2, + "step": 1 + } + }, + "reverse_energy_total": { + "type": "Integer", + "value": { + "unit": "kW·h", + "min": 0, + "max": 99999999, + "scale": 2, + "step": 1 + } + }, + "phase_a": { + "type": "Json", + "value": {} + }, + "phase_b": { + "type": "Json", + "value": {} + }, + "phase_c": { + "type": "Json", + "value": {} + }, + "power_total": { + "type": "Integer", + "value": { + "unit": "kW", + "min": -99999999, + "max": 999999999, + "scale": 3, + "step": 1 + } + }, + "fault": { + "type": "Bitmap", + "value": { + "label": [ + "ov_pwr_t", + "ov_pwr_a", + "ov_pwr_b", + "ov_pwr_c", + "un_pwr_t", + "un_pwr_a", + "un_pwr_b", + "un_pwr_c" + ] + } + }, + "alarm_set_2": { + "type": "Json", + "value": {} + }, + "clear": { + "type": "Boolean", + "value": {} + } + }, + "status": { + "forward_energy_total": 0, + "reverse_energy_total": 0, + "phase_a": { + "voltage": 230.1, + "electricCurrent": 53.86, + "power": 9.548, + "reactivePower": 0.0, + "apparentPower": 0.0, + "powerFactor": 0.77 + }, + "phase_b": { + "voltage": 231.8, + "electricCurrent": 49.202, + "power": 9.51, + "reactivePower": 0.0, + "apparentPower": 0.0, + "powerFactor": 0.83 + }, + "phase_c": { + "voltage": 229.6, + "electricCurrent": 50.914, + "power": 10.006, + "reactivePower": 0.0, + "apparentPower": 0.0, + "powerFactor": 0.86 + }, + "power_total": -99999999, + "fault": 0, + "alarm_set_2": "[]", + "clear": false + }, + "set_up": false, + "support_local": true +} diff --git a/tests/components/tuya/fixtures/zndb_uqzhc4bx5zqwpg2m.json b/tests/components/tuya/fixtures/zndb_uqzhc4bx5zqwpg2m.json new file mode 100644 index 000000000000..24534accf98f --- /dev/null +++ b/tests/components/tuya/fixtures/zndb_uqzhc4bx5zqwpg2m.json @@ -0,0 +1,74 @@ +{ + "endpoint": "https://apigw.tuyacn.com", + "mqtt_connected": true, + "disabled_by": null, + "disabled_polling": false, + "name": "多路计量有线demo26082501", + "category": "zndb", + "product_id": "uqzhc4bx5zqwpg2m", + "product_name": "多路计量有线demo26082501", + "online": true, + "sub": false, + "time_zone": "+8:00", + "active_time": "2026-09-03T02:02:14+00:00", + "create_time": "2026-09-03T02:02:14+00:00", + "update_time": "2026-09-03T02:02:14+00:00", + "function": { + "event_clear": { + "code": "event_clear", + "type": "Boolean", + "value": {} + } + }, + "status_range": { + "phase_s1": { + "type": "String", + "value": {} + }, + "meter_id": { + "type": "String", + "value": { + "maxlen": 255 + } + }, + "imei_imsi": { + "type": "Json", + "value": {} + }, + "supply_frequency": { + "type": "Integer", + "value": { + "unit": "Hz", + "min": 0, + "max": 9999, + "scale": 2, + "step": 1 + } + }, + "ct_ration": { + "type": "Raw", + "value": {} + }, + "event_clear": { + "type": "Boolean", + "value": {} + }, + "online_state": { + "type": "Enum", + "value": { + "range": ["online", "offline"] + } + } + }, + "status": { + "phase_s1": "020F08FD00D26400254C0000000000004D00", + "meter_id": "", + "imei_imsi": "", + "supply_frequency": 0, + "ct_ration": "", + "event_clear": false, + "online_state": "online" + }, + "set_up": false, + "support_local": true +} diff --git a/tests/components/tuya/snapshots/test_init.ambr b/tests/components/tuya/snapshots/test_init.ambr index 94ee2b2996b3..ca8af6a978a1 100644 --- a/tests/components/tuya/snapshots/test_init.ambr +++ b/tests/components/tuya/snapshots/test_init.ambr @@ -5039,6 +5039,36 @@ 'via_device_id': None, }) # --- +# name: test_device_registry[jpry3yxd77xu5woibdnz] + 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', + 'jpry3yxd77xu5woibdnz', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'Tuya', + 'model': 'Three Phase Energy Meter', + 'model_id': 'iow5ux77dxy3yrpj', + 'name': '三相电能表 2', + 'name_by_user': None, + 'serial_number': None, + 'sw_version': None, + 'via_device_id': None, + }) +# --- # name: test_device_registry[jzpap0inhkykqtlwgklc] DeviceRegistryEntrySnapshot({ 'area_id': None, @@ -5609,6 +5639,36 @@ 'via_device_id': None, }) # --- +# name: test_device_registry[m2gpwqz5xb4chzqubdnz] + 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', + 'm2gpwqz5xb4chzqubdnz', + ), + }), + 'labels': set({ + }), + 'manufacturer': 'Tuya', + 'model': '多路计量有线demo26082501', + 'model_id': 'uqzhc4bx5zqwpg2m', + 'name': '多路计量有线demo26082501', + '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_sensor.ambr b/tests/components/tuya/snapshots/test_sensor.ambr index 185c13e15244..d43d76529680 100644 --- a/tests/components/tuya/snapshots/test_sensor.ambr +++ b/tests/components/tuya/snapshots/test_sensor.ambr @@ -6541,6 +6541,64 @@ 'state': '0.12', }) # --- +# name: test_platform_setup_and_discovery[sensor.duo_lu_ji_liang_you_xian_demo26082501_supply_frequency-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.duo_lu_ji_liang_you_xian_demo26082501_supply_frequency', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Supply frequency', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Supply frequency', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'supply_frequency', + 'unique_id': 'tuya.m2gpwqz5xb4chzqubdnzsupply_frequency', + 'unit_of_measurement': 'Hz', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.duo_lu_ji_liang_you_xian_demo26082501_supply_frequency-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'frequency', + : '多路计量有线demo26082501 Supply frequency', + : , + : 'Hz', + }), + 'context': , + 'entity_id': 'sensor.duo_lu_ji_liang_you_xian_demo26082501_supply_frequency', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.eau_chaude_current-entry] EntityRegistryEntrySnapshot({ 'aliases': list([ @@ -19643,6 +19701,702 @@ 'state': '1.17', }) # --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_current-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.san_xiang_dian_neng_biao_2_phase_a_current', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase A current', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase A current', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_a_current', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_aelectriccurrent', + 'unit_of_measurement': 'A', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_current-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'current', + : '三相电能表 2 Phase A current', + : , + : 'A', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_a_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '53.86', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_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.san_xiang_dian_neng_biao_2_phase_a_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase A power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase A power', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_a_power', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_apower', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : '三相电能表 2 Phase A power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_a_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '9.548', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_voltage-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.san_xiang_dian_neng_biao_2_phase_a_voltage', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase A voltage', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase A voltage', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_a_voltage', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_avoltage', + 'unit_of_measurement': 'V', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_a_voltage-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'voltage', + : '三相电能表 2 Phase A voltage', + : , + : 'V', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_a_voltage', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '230.1', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_current-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.san_xiang_dian_neng_biao_2_phase_b_current', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase B current', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase B current', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_b_current', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_belectriccurrent', + 'unit_of_measurement': 'A', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_current-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'current', + : '三相电能表 2 Phase B current', + : , + : 'A', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_b_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '49.202', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_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.san_xiang_dian_neng_biao_2_phase_b_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase B power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase B power', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_b_power', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_bpower', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : '三相电能表 2 Phase B power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_b_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '9.51', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_voltage-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.san_xiang_dian_neng_biao_2_phase_b_voltage', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase B voltage', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase B voltage', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_b_voltage', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_bvoltage', + 'unit_of_measurement': 'V', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_b_voltage-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'voltage', + : '三相电能表 2 Phase B voltage', + : , + : 'V', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_b_voltage', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '231.8', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_current-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.san_xiang_dian_neng_biao_2_phase_c_current', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase C current', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase C current', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_c_current', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_celectriccurrent', + 'unit_of_measurement': 'A', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_current-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'current', + : '三相电能表 2 Phase C current', + : , + : 'A', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_c_current', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '50.914', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_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.san_xiang_dian_neng_biao_2_phase_c_power', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase C power', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase C power', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_c_power', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_cpower', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : '三相电能表 2 Phase C power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_c_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '10.006', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_voltage-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.san_xiang_dian_neng_biao_2_phase_c_voltage', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Phase C voltage', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 0, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Phase C voltage', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'phase_c_voltage', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzphase_cvoltage', + 'unit_of_measurement': 'V', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_phase_c_voltage-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'voltage', + : '三相电能表 2 Phase C voltage', + : , + : 'V', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_phase_c_voltage', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '229.6', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_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.san_xiang_dian_neng_biao_2_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.jpry3yxd77xu5woibdnzforward_energy_total', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_total_energy-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'energy', + : '三相电能表 2 Total energy', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_total_energy', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_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.san_xiang_dian_neng_biao_2_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.jpry3yxd77xu5woibdnzpower_total', + 'unit_of_measurement': 'kW', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_total_power-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'power', + : '三相电能表 2 Total power', + : , + : 'kW', + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_total_power', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '-99999.999', + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_total_production-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.san_xiang_dian_neng_biao_2_total_production', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'object_id_base': 'Total production', + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 2, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Total production', + 'platform': 'tuya', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'total_production', + 'unique_id': 'tuya.jpry3yxd77xu5woibdnzreverse_energy_total', + 'unit_of_measurement': , + }) +# --- +# name: test_platform_setup_and_discovery[sensor.san_xiang_dian_neng_biao_2_total_production-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + : 'energy', + : '三相电能表 2 Total production', + : , + : , + }), + 'context': , + 'entity_id': 'sensor.san_xiang_dian_neng_biao_2_total_production', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '0.0', + }) +# --- # name: test_platform_setup_and_discovery[sensor.sapphire_current-entry] EntityRegistryEntrySnapshot({ 'aliases': list([