Files
core/tests/components/ccm15/snapshots/test_climate.ambr
Oscar Calvo b2caf15434 New integration Midea ccm15 climate (#94824)
* Initial commit

* Correct settings for config flow

* Use scan interval

* Store proper data

* Remove circular dependency

* Remove circular dependency

* Integration can be initialized

* Fix defaults

* Add setup entry

* Add setup entry

* Dont block forever

* Poll during async_setup_entry

* Remove not needed async methods

* Add debug info

* Parse binary data

* Parse binary data

* Use data to update device

* Use data to update device

* Add CCM15DeviceState

* Use DataCoordinator

* Use DataCoordinator

* Use DataCoordinator

* Use CoordinatorEntity

* Use CoordinatorEntity

* Call update API

* Call update API

* Call update API

* Call update API

* Use dataclass

* Use dataclass

* Use dataclass

* Use dataclass

* Use dataclass

* Use dataclass

* Use dataclass

* Use dataclass

* Fix bugs

* Implement swing

* Support swing mode, read only

* Add unit test

* Swing should work

* Set swing mode

* Add DeviceInfo

* Add error code

* Add error code

* Add error code

* Add error code

* Initial commit

* Refactor

* Remove comment code

* Try remove circular ref

* Try remove circular ref

* Remove circular ref

* Fix bug

* Fix tests

* Fix tests

* Increase test coverage

* Increase test coverage

* Increase test coverrage

* Add more unit tests

* Increase coverage

* Update coordinator.py

* Fix ruff

* Set unit of temperature

* Add bounds check

* Fix unit tests

* Add test coverage

* Use Py-ccm15

* Update tests

* Upgrade dependency

* Apply PR feedback

* Upgrade dependency

* Upgrade dependency

* Upgrade dependency

* Force ruff

* Delete not needed consts

* Fix mypy

* Update homeassistant/components/ccm15/coordinator.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Apply PR Feedback

* Apply PR Feedback

* Apply PR Feedback

* Apply PR Feedback

* Apply PR Feedback

* Apply PR Feedback

* Fix unit tests

* Move climate instance

* Revert "Move climate instance"

This reverts commit cc5b9916b7.

* Apply PR feedback

* Apply PR Feedback

* Remove scan internal parameter

* Update homeassistant/components/ccm15/coordinator.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Remove empty keys

* Fix tests

* Use attr fields

* Try refactor

* Check for multiple hosts

* Check for duplicates

* Fix tests

* Use PRECISION_WHOLE

* Use str(ac_index)

* Move {self._ac_host}.{self._ac_index} to construtor

* Make it fancy

* Update homeassistant/components/ccm15/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Move const to class variables

* Use actual config host

* Move device info to construtor

* Update homeassistant/components/ccm15/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Set name to none, dont ask for poll

* Undo name change

* Dont use coordinator in config flow

* Dont use coordinator in config flow

* Check already configured

* Apply PR comments

* Move above

* Use device info name

* Update tests/components/ccm15/test_coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/ccm15/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Apply feedback

* Remove logger debug calls

* Add new test to check for dupplicates

* Test error

* Use better name for test

* Update homeassistant/components/ccm15/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/ccm15/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/ccm15/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Use prop data for all getters

* Fix tests

* Improve tests

* Improve tests, v2

* Replace log message by comment

* No need to do bounds check

* Update config_flow.py

* Update test_config_flow.py

* Update test_coordinator.py

* Update test_coordinator.py

* Create test_climate.py

* Delete tests/components/ccm15/test_coordinator.py

* Update coordinator.py

* Update __init__.py

* Create test_climate.ambr

* Update conftest.py

* Update test_climate.py

* Create test_init.py

* Update .coveragerc

* Update __init__.py

* We need to check bounds after all

* Add more test coverage

* Test is not None

* Use better naming

* fix tests

* Add available property

* Update homeassistant/components/ccm15/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Use snapshots to simulate netwrok failure or power failure

* Remove not needed test

* Use walrus

---------

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-12-23 21:24:52 +01:00

352 lines
8.0 KiB
Plaintext

# serializer version: 1
# name: test_climate_state
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.midea_0',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'ccm15',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 41>,
'translation_key': None,
'unique_id': '1.1.1.1.0',
'unit_of_measurement': None,
})
# ---
# name: test_climate_state.1
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.midea_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'ccm15',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 41>,
'translation_key': None,
'unique_id': '1.1.1.1.1',
'unit_of_measurement': None,
})
# ---
# name: test_climate_state.2
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 27,
'error_code': 0,
'fan_mode': 'off',
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'friendly_name': 'Midea 0',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'supported_features': <ClimateEntityFeature: 41>,
'swing_mode': 'off',
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
'temperature': 23,
}),
'context': <ANY>,
'entity_id': 'climate.midea_0',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_climate_state.3
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 26,
'error_code': 0,
'fan_mode': 'low',
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'friendly_name': 'Midea 1',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'supported_features': <ClimateEntityFeature: 41>,
'swing_mode': 'off',
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
'temperature': 24,
}),
'context': <ANY>,
'entity_id': 'climate.midea_1',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
# name: test_climate_state.4
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.midea_0',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'ccm15',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 41>,
'translation_key': None,
'unique_id': '1.1.1.1.0',
'unit_of_measurement': None,
})
# ---
# name: test_climate_state.5
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.midea_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'ccm15',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 41>,
'translation_key': None,
'unique_id': '1.1.1.1.1',
'unit_of_measurement': None,
})
# ---
# name: test_climate_state.6
StateSnapshot({
'attributes': ReadOnlyDict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'friendly_name': 'Midea 0',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'supported_features': <ClimateEntityFeature: 41>,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'context': <ANY>,
'entity_id': 'climate.midea_0',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_climate_state.7
StateSnapshot({
'attributes': ReadOnlyDict({
'fan_modes': list([
'auto',
'low',
'medium',
'high',
]),
'friendly_name': 'Midea 1',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.AUTO: 'auto'>,
]),
'max_temp': 35,
'min_temp': 7,
'supported_features': <ClimateEntityFeature: 41>,
'swing_modes': list([
'off',
'on',
]),
'target_temp_step': 1,
}),
'context': <ANY>,
'entity_id': 'climate.midea_1',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---