Skip to content

Commit

Permalink
Add snapshot tests to Balboa (#117620)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored May 17, 2024
1 parent 081bf1c commit 0b8a5ac
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 32 deletions.
142 changes: 142 additions & 0 deletions tests/components/balboa/snapshots/test_binary_sensor.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# serializer version: 1
# name: test_binary_sensors[binary_sensor.fakespa_circulation_pump-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.fakespa_circulation_pump',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Circulation pump',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'circ_pump',
'unique_id': 'FakeSpa-Circ Pump-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[binary_sensor.fakespa_circulation_pump-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'FakeSpa Circulation pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.fakespa_circulation_pump',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[binary_sensor.fakespa_filter_cycle_1-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.fakespa_filter_cycle_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Filter cycle 1',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'filter_1',
'unique_id': 'FakeSpa-Filter1-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[binary_sensor.fakespa_filter_cycle_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'FakeSpa Filter cycle 1',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.fakespa_filter_cycle_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[binary_sensor.fakespa_filter_cycle_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.fakespa_filter_cycle_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Filter cycle 2',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'filter_2',
'unique_id': 'FakeSpa-Filter2-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[binary_sensor.fakespa_filter_cycle_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'FakeSpa Filter cycle 2',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.fakespa_filter_cycle_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
74 changes: 74 additions & 0 deletions tests/components/balboa/snapshots/test_climate.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# serializer version: 1
# name: test_climate[climate.fakespa-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 40.0,
'min_temp': 10.0,
'preset_modes': list([
'ready',
'rest',
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.fakespa',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:hot-tub',
'original_name': None,
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 401>,
'translation_key': 'balboa',
'unique_id': 'FakeSpa-Climate-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_climate[climate.fakespa-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 10.0,
'friendly_name': 'FakeSpa',
'hvac_action': <HVACAction.IDLE: 'idle'>,
'hvac_modes': list([
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
]),
'icon': 'mdi:hot-tub',
'max_temp': 40.0,
'min_temp': 10.0,
'preset_mode': 'ready',
'preset_modes': list([
'ready',
'rest',
]),
'supported_features': <ClimateEntityFeature: 401>,
'temperature': 40.0,
}),
'context': <ANY>,
'entity_id': 'climate.fakespa',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
54 changes: 54 additions & 0 deletions tests/components/balboa/snapshots/test_fan.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# serializer version: 1
# name: test_fan[fan.fakespa_pump_1-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'preset_modes': None,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'fan',
'entity_category': None,
'entity_id': 'fan.fakespa_pump_1',
'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': 'Pump 1',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': <FanEntityFeature: 1>,
'translation_key': 'pump',
'unique_id': 'FakeSpa-Pump 1-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_fan[fan.fakespa_pump_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'FakeSpa Pump 1',
'percentage': 0,
'percentage_step': 50.0,
'preset_mode': None,
'preset_modes': None,
'supported_features': <FanEntityFeature: 1>,
}),
'context': <ANY>,
'entity_id': 'fan.fakespa_pump_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
56 changes: 56 additions & 0 deletions tests/components/balboa/snapshots/test_light.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# serializer version: 1
# name: test_lights[light.fakespa_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.fakespa_light',
'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': 'Light',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'only_light',
'unique_id': 'FakeSpa-Light-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_lights[light.fakespa_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'color_mode': None,
'friendly_name': 'FakeSpa Light',
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.fakespa_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
57 changes: 57 additions & 0 deletions tests/components/balboa/snapshots/test_select.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# serializer version: 1
# name: test_selects[select.fakespa_temperature_range-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'low',
'high',
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.fakespa_temperature_range',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:thermometer-lines',
'original_name': 'Temperature range',
'platform': 'balboa',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'temperature_range',
'unique_id': 'FakeSpa-TempHiLow-c0ffee',
'unit_of_measurement': None,
})
# ---
# name: test_selects[select.fakespa_temperature_range-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'FakeSpa Temperature range',
'icon': 'mdi:thermometer-lines',
'options': list([
'low',
'high',
]),
}),
'context': <ANY>,
'entity_id': 'select.fakespa_temperature_range',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'low',
})
# ---
Loading

0 comments on commit 0b8a5ac

Please sign in to comment.