Skip to content

Commit

Permalink
Add new HomeWizard Energy Socket to tests (#113406)
Browse files Browse the repository at this point in the history
  • Loading branch information
DCSBL authored Mar 22, 2024
1 parent 7df0d3b commit cad3be8
Show file tree
Hide file tree
Showing 17 changed files with 3,307 additions and 10,963 deletions.
16 changes: 16 additions & 0 deletions tests/components/homewizard/fixtures/HWE-SKT-21/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"wifi_ssid": "My Wi-Fi",
"wifi_strength": 100,
"total_power_import_kwh": 30.511,
"total_power_import_t1_kwh": 30.511,
"total_power_export_kwh": 85.951,
"total_power_export_t1_kwh": 85.951,
"active_power_w": 543.312,
"active_power_l1_w": 543.312,
"active_voltage_v": 231.539,
"active_current_a": 2.346,
"active_reactive_power_var": 123.456,
"active_apparent_power_va": 666.768,
"active_power_factor": 0.81688,
"active_frequency_hz": 50.005
}
7 changes: 7 additions & 0 deletions tests/components/homewizard/fixtures/HWE-SKT-21/device.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"product_type": "HWE-SKT",
"product_name": "Energy Socket",
"serial": "3c39e7aabbcc",
"firmware_version": "4.07",
"api_version": "v1"
}
5 changes: 5 additions & 0 deletions tests/components/homewizard/fixtures/HWE-SKT-21/state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"power_on": true,
"switch_lock": false,
"brightness": 255
}
3 changes: 3 additions & 0 deletions tests/components/homewizard/fixtures/HWE-SKT-21/system.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cloud_enabled": true
}
89 changes: 88 additions & 1 deletion tests/components/homewizard/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
}),
})
# ---
# name: test_diagnostics[HWE-SKT]
# name: test_diagnostics[HWE-SKT-11]
dict({
'data': dict({
'data': dict({
Expand Down Expand Up @@ -386,6 +386,93 @@
}),
})
# ---
# name: test_diagnostics[HWE-SKT-21]
dict({
'data': dict({
'data': dict({
'active_apparent_power_l1_va': None,
'active_apparent_power_l2_va': None,
'active_apparent_power_l3_va': None,
'active_apparent_power_va': 666.768,
'active_current_a': 2.346,
'active_current_l1_a': None,
'active_current_l2_a': None,
'active_current_l3_a': None,
'active_frequency_hz': 50.005,
'active_liter_lpm': None,
'active_power_average_w': None,
'active_power_factor': 0.81688,
'active_power_factor_l1': None,
'active_power_factor_l2': None,
'active_power_factor_l3': None,
'active_power_l1_w': 543.312,
'active_power_l2_w': None,
'active_power_l3_w': None,
'active_power_w': 543.312,
'active_reactive_power_l1_var': None,
'active_reactive_power_l2_var': None,
'active_reactive_power_l3_var': None,
'active_reactive_power_var': 123.456,
'active_tariff': None,
'active_voltage_l1_v': None,
'active_voltage_l2_v': None,
'active_voltage_l3_v': None,
'active_voltage_v': 231.539,
'any_power_fail_count': None,
'external_devices': None,
'gas_timestamp': None,
'gas_unique_id': None,
'long_power_fail_count': None,
'meter_model': None,
'monthly_power_peak_timestamp': None,
'monthly_power_peak_w': None,
'smr_version': None,
'total_energy_export_kwh': 85.951,
'total_energy_export_t1_kwh': 85.951,
'total_energy_export_t2_kwh': None,
'total_energy_export_t3_kwh': None,
'total_energy_export_t4_kwh': None,
'total_energy_import_kwh': 30.511,
'total_energy_import_t1_kwh': 30.511,
'total_energy_import_t2_kwh': None,
'total_energy_import_t3_kwh': None,
'total_energy_import_t4_kwh': None,
'total_gas_m3': None,
'total_liter_m3': None,
'unique_meter_id': None,
'voltage_sag_l1_count': None,
'voltage_sag_l2_count': None,
'voltage_sag_l3_count': None,
'voltage_swell_l1_count': None,
'voltage_swell_l2_count': None,
'voltage_swell_l3_count': None,
'wifi_ssid': '**REDACTED**',
'wifi_strength': 100,
}),
'device': dict({
'api_version': 'v1',
'firmware_version': '4.07',
'product_name': 'Energy Socket',
'product_type': 'HWE-SKT',
'serial': '**REDACTED**',
}),
'state': dict({
'brightness': 255,
'power_on': True,
'switch_lock': False,
}),
'system': dict({
'cloud_enabled': True,
}),
}),
'entry': dict({
'ip_address': '**REDACTED**',
'product_name': 'Product name',
'product_type': 'product_type',
'serial': '**REDACTED**',
}),
})
# ---
# name: test_diagnostics[HWE-WTR]
dict({
'data': dict({
Expand Down
96 changes: 93 additions & 3 deletions tests/components/homewizard/snapshots/test_number.ambr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_number_entities[HWE-SKT]
# name: test_number_entities[HWE-SKT-11]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Device Status light brightness',
Expand All @@ -17,7 +17,7 @@
'state': '100.0',
})
# ---
# name: test_number_entities[HWE-SKT].1
# name: test_number_entities[HWE-SKT-11].1
EntityRegistryEntrySnapshot({
'aliases': set({
}),
Expand Down Expand Up @@ -55,7 +55,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_number_entities[HWE-SKT].2
# name: test_number_entities[HWE-SKT-11].2
DeviceRegistryEntrySnapshot({
'area_id': None,
'config_entries': <ANY>,
Expand Down Expand Up @@ -89,3 +89,93 @@
'via_device_id': None,
})
# ---
# name: test_number_entities[HWE-SKT-21]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Device Status light brightness',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.device_status_light_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '100.0',
})
# ---
# name: test_number_entities[HWE-SKT-21].1
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.device_status_light_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Status light brightness',
'platform': 'homewizard',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'status_light_brightness',
'unique_id': 'aabbccddeeff_status_light_brightness',
'unit_of_measurement': '%',
})
# ---
# name: test_number_entities[HWE-SKT-21].2
DeviceRegistryEntrySnapshot({
'area_id': None,
'config_entries': <ANY>,
'configuration_url': None,
'connections': set({
tuple(
'mac',
'3c:39:e7:aa:bb:cc',
),
}),
'disabled_by': None,
'entry_type': None,
'hw_version': None,
'id': <ANY>,
'identifiers': set({
tuple(
'homewizard',
'3c39e7aabbcc',
),
}),
'is_new': False,
'labels': set({
}),
'manufacturer': 'HomeWizard',
'model': 'HWE-SKT',
'name': 'Device',
'name_by_user': None,
'serial_number': None,
'suggested_area': None,
'sw_version': '4.07',
'via_device_id': None,
})
# ---
Loading

0 comments on commit cad3be8

Please sign in to comment.