Skip to content

Commit

Permalink
Adjust HomeWizard test fixtures to match actual devices (home-assista…
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Nov 26, 2023
1 parent e2e58c4 commit bd27358
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 160 deletions.
40 changes: 1 addition & 39 deletions tests/components/homewizard/fixtures/HWE-SKT/data.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
{
"wifi_ssid": "My Wi-Fi",
"wifi_strength": 94,
"smr_version": null,
"meter_model": null,
"unique_meter_id": null,
"active_tariff": null,
"total_power_import_kwh": null,
"total_power_import_t1_kwh": 63.651,
"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": 0,
"total_power_export_t2_kwh": null,
"total_power_export_t3_kwh": null,
"total_power_export_t4_kwh": null,
"active_power_w": 1457.277,
"active_power_l1_w": 1457.277,
"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": null,
"total_liter_m3": null,
"external_devices": null
"active_power_l1_w": 1457.277
}
42 changes: 1 addition & 41 deletions tests/components/homewizard/fixtures/HWE-WTR/data.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,6 @@
{
"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
"total_liter_m3": 17.014
}
40 changes: 1 addition & 39 deletions tests/components/homewizard/fixtures/SDM230/data.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
{
"wifi_ssid": "My Wi-Fi",
"wifi_strength": 92,
"smr_version": null,
"meter_model": null,
"unique_meter_id": null,
"active_tariff": null,
"total_power_import_kwh": 2.705,
"total_power_import_t1_kwh": 2.705,
"total_power_import_t2_kwh": null,
"total_power_import_t3_kwh": null,
"total_power_import_t4_kwh": null,
"total_power_export_kwh": 255.551,
"total_power_export_t1_kwh": 255.551,
"total_power_export_t2_kwh": null,
"total_power_export_t3_kwh": null,
"total_power_export_t4_kwh": null,
"active_power_w": -1058.296,
"active_power_l1_w": -1058.296,
"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": null,
"total_liter_m3": null,
"external_devices": null
"active_power_l1_w": -1058.296
}
38 changes: 1 addition & 37 deletions tests/components/homewizard/fixtures/SDM630/data.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,10 @@
{
"wifi_ssid": "My Wi-Fi",
"wifi_strength": 92,
"smr_version": null,
"meter_model": null,
"unique_meter_id": null,
"active_tariff": null,
"total_power_import_kwh": 0.101,
"total_power_import_t1_kwh": 0.101,
"total_power_import_t2_kwh": null,
"total_power_import_t3_kwh": null,
"total_power_import_t4_kwh": null,
"total_power_export_kwh": 0.523,
"total_power_export_t1_kwh": 0.523,
"total_power_export_t2_kwh": null,
"total_power_export_t3_kwh": null,
"total_power_export_t4_kwh": null,
"active_power_w": -900.194,
"active_power_l1_w": -1058.296,
"active_power_l2_w": 158.102,
"active_power_l3_w": 0.0,
"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": null,
"total_liter_m3": null,
"external_devices": null
"active_power_l3_w": 0.0
}
4 changes: 2 additions & 2 deletions tests/components/homewizard/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@
'monthly_power_peak_timestamp': None,
'monthly_power_peak_w': None,
'smr_version': None,
'total_energy_export_kwh': None,
'total_energy_export_kwh': 0,
'total_energy_export_t1_kwh': 0,
'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_kwh': 63.651,
'total_energy_import_t1_kwh': 63.651,
'total_energy_import_t2_kwh': None,
'total_energy_import_t3_kwh': None,
Expand Down
160 changes: 160 additions & 0 deletions tests/components/homewizard/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -6105,6 +6105,86 @@
'state': '1457.277',
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_export:device-registry]
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,
'manufacturer': 'HomeWizard',
'model': 'HWE-SKT',
'name': 'Device',
'name_by_user': None,
'serial_number': None,
'suggested_area': None,
'sw_version': '3.03',
'via_device_id': None,
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_export:entity-registry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.device_total_energy_export',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
'original_icon': None,
'original_name': 'Total energy export',
'platform': 'homewizard',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'total_energy_export_kwh',
'unique_id': 'aabbccddeeff_total_power_export_kwh',
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_export:state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'energy',
'friendly_name': 'Device Total energy export',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
'context': <ANY>,
'entity_id': 'sensor.device_total_energy_export',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': '0',
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_export_tariff_1:device-registry]
DeviceRegistryEntrySnapshot({
'area_id': None,
Expand Down Expand Up @@ -6185,6 +6265,86 @@
'state': '0',
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_import:device-registry]
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,
'manufacturer': 'HomeWizard',
'model': 'HWE-SKT',
'name': 'Device',
'name_by_user': None,
'serial_number': None,
'suggested_area': None,
'sw_version': '3.03',
'via_device_id': None,
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_import:entity-registry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.device_total_energy_import',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
'original_icon': None,
'original_name': 'Total energy import',
'platform': 'homewizard',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'total_energy_import_kwh',
'unique_id': 'aabbccddeeff_total_power_import_kwh',
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_import:state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'energy',
'friendly_name': 'Device Total energy import',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
'context': <ANY>,
'entity_id': 'sensor.device_total_energy_import',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': '63.651',
})
# ---
# name: test_sensors[HWE-SKT-entity_ids2][sensor.device_total_energy_import_tariff_1:device-registry]
DeviceRegistryEntrySnapshot({
'area_id': None,
Expand Down
Loading

0 comments on commit bd27358

Please sign in to comment.