Skip to content

Commit

Permalink
Add device fixtures and tests for HomeWizard Energy Watersensor (#103383
Browse files Browse the repository at this point in the history
)

Co-authored-by: Duco Sebel <[email protected]>
  • Loading branch information
frenck and DCSBL authored Nov 6, 2023
1 parent ad22a11 commit 08b43c4
Show file tree
Hide file tree
Showing 9 changed files with 695 additions and 142 deletions.
46 changes: 46 additions & 0 deletions tests/components/homewizard/fixtures/HWE-WTR/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"wifi_ssid": "My Wi-Fi",
"wifi_strength": 84,
"smr_version": null,
"meter_model": null,
"unique_meter_id": null,
"active_tariff": null,
"total_power_import_kwh": null,
"total_power_import_t1_kwh": null,
"total_power_import_t2_kwh": null,
"total_power_import_t3_kwh": null,
"total_power_import_t4_kwh": null,
"total_power_export_kwh": null,
"total_power_export_t1_kwh": null,
"total_power_export_t2_kwh": null,
"total_power_export_t3_kwh": null,
"total_power_export_t4_kwh": null,
"active_power_w": null,
"active_power_l1_w": null,
"active_power_l2_w": null,
"active_power_l3_w": null,
"active_voltage_l1_v": null,
"active_voltage_l2_v": null,
"active_voltage_l3_v": null,
"active_current_l1_a": null,
"active_current_l2_a": null,
"active_current_l3_a": null,
"active_frequency_hz": null,
"voltage_sag_l1_count": null,
"voltage_sag_l2_count": null,
"voltage_sag_l3_count": null,
"voltage_swell_l1_count": null,
"voltage_swell_l2_count": null,
"voltage_swell_l3_count": null,
"any_power_fail_count": null,
"long_power_fail_count": null,
"active_power_average_w": null,
"monthly_power_peak_w": null,
"monthly_power_peak_timestamp": null,
"total_gas_m3": null,
"gas_timestamp": null,
"gas_unique_id": null,
"active_liter_lpm": 0,
"total_liter_m3": 17.014,
"external_devices": null
}
7 changes: 7 additions & 0 deletions tests/components/homewizard/fixtures/HWE-WTR/device.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"product_type": "HWE-WTR",
"product_name": "Watermeter",
"serial": "3c39e7aabbcc",
"firmware_version": "2.03",
"api_version": "v1"
}
67 changes: 67 additions & 0 deletions tests/components/homewizard/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,73 @@
}),
})
# ---
# name: test_diagnostics[HWE-WTR]
dict({
'data': dict({
'data': dict({
'active_current_l1_a': None,
'active_current_l2_a': None,
'active_current_l3_a': None,
'active_frequency_hz': None,
'active_liter_lpm': 0,
'active_power_average_w': None,
'active_power_l1_w': None,
'active_power_l2_w': None,
'active_power_l3_w': None,
'active_power_w': None,
'active_tariff': None,
'active_voltage_l1_v': None,
'active_voltage_l2_v': None,
'active_voltage_l3_v': None,
'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': None,
'total_energy_export_t1_kwh': None,
'total_energy_export_t2_kwh': None,
'total_energy_export_t3_kwh': None,
'total_energy_export_t4_kwh': None,
'total_energy_import_kwh': None,
'total_energy_import_t1_kwh': None,
'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': 17.014,
'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': 84,
}),
'device': dict({
'api_version': 'v1',
'firmware_version': '2.03',
'product_name': 'Watermeter',
'product_type': 'HWE-WTR',
'serial': '**REDACTED**',
}),
'state': None,
'system': None,
}),
'entry': dict({
'ip_address': '**REDACTED**',
'product_name': 'Product name',
'product_type': 'product_type',
'serial': '**REDACTED**',
}),
})
# ---
# name: test_diagnostics[SDM230]
dict({
'data': dict({
Expand Down
Loading

0 comments on commit 08b43c4

Please sign in to comment.