Skip to content

Commit f83757d

Browse files
authored
Use unique fibaro_id in test fixtures (home-assistant#164763)
1 parent ca338c9 commit f83757d

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

tests/components/fibaro/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def mock_power_sensor() -> Mock:
8686
def mock_positionable_cover() -> Mock:
8787
"""Fixture for a positionable cover."""
8888
cover = Mock()
89-
cover.fibaro_id = 3
89+
cover.fibaro_id = 2
9090
cover.parent_fibaro_id = 0
9191
cover.name = "Test cover"
9292
cover.room_id = 1
@@ -209,7 +209,7 @@ def mock_zigbee_light() -> Mock:
209209
def mock_thermostat() -> Mock:
210210
"""Fixture for a thermostat."""
211211
climate = Mock()
212-
climate.fibaro_id = 4
212+
climate.fibaro_id = 13
213213
climate.parent_fibaro_id = 0
214214
climate.name = "Test climate"
215215
climate.room_id = 1
@@ -290,7 +290,7 @@ def mock_thermostat_with_operating_mode() -> Mock:
290290
def mock_thermostat_quickapp_1() -> Mock:
291291
"""Fixture for a thermostat."""
292292
climate = Mock()
293-
climate.fibaro_id = 6
293+
climate.fibaro_id = 9
294294
climate.parent_fibaro_id = 0
295295
climate.has_endpoint_id = False
296296
climate.name = "Test climate"
@@ -321,7 +321,7 @@ def mock_thermostat_quickapp_1() -> Mock:
321321
def mock_thermostat_quickapp_2() -> Mock:
322322
"""Fixture for a thermostat."""
323323
climate = Mock()
324-
climate.fibaro_id = 7
324+
climate.fibaro_id = 10
325325
climate.parent_fibaro_id = 0
326326
climate.has_endpoint_id = False
327327
climate.name = "Test climate 2"

tests/components/fibaro/test_climate.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ async def test_climate_setup(
3030
# Act
3131
await init_integration(hass, mock_config_entry)
3232
# Assert
33-
entry = entity_registry.async_get("climate.room_1_test_climate_4")
33+
entry = entity_registry.async_get("climate.room_1_test_climate_13")
3434
assert entry
35-
assert entry.unique_id == "hc2_111111.4"
35+
assert entry.unique_id == "hc2_111111.13"
3636
assert entry.original_name == "Room 1 Test climate"
3737
assert entry.supported_features == (
3838
ClimateEntityFeature.TURN_ON
@@ -63,9 +63,9 @@ async def test_climate_setup_2_quickapps(
6363
# Act
6464
await init_integration(hass, mock_config_entry)
6565
# Assert
66-
entry1 = entity_registry.async_get("climate.room_1_test_climate_6")
66+
entry1 = entity_registry.async_get("climate.room_1_test_climate_9")
6767
assert entry1
68-
entry2 = entity_registry.async_get("climate.room_1_test_climate_2_7")
68+
entry2 = entity_registry.async_get("climate.room_1_test_climate_2_10")
6969
assert entry2
7070

7171

@@ -86,7 +86,7 @@ async def test_hvac_mode_preset(
8686
# Act
8787
await init_integration(hass, mock_config_entry)
8888
# Assert
89-
state = hass.states.get("climate.room_1_test_climate_4")
89+
state = hass.states.get("climate.room_1_test_climate_13")
9090
assert state.state == HVACMode.AUTO
9191
assert state.attributes["preset_mode"] == "CustomerSpecific"
9292

@@ -109,7 +109,7 @@ async def test_hvac_mode_heat(
109109
# Act
110110
await init_integration(hass, mock_config_entry)
111111
# Assert
112-
state = hass.states.get("climate.room_1_test_climate_4")
112+
state = hass.states.get("climate.room_1_test_climate_13")
113113
assert state.state == HVACMode.HEAT
114114
assert state.attributes["preset_mode"] is None
115115

@@ -133,7 +133,7 @@ async def test_set_hvac_mode(
133133
await hass.services.async_call(
134134
"climate",
135135
"set_hvac_mode",
136-
{"entity_id": "climate.room_1_test_climate_4", "hvac_mode": HVACMode.HEAT},
136+
{"entity_id": "climate.room_1_test_climate_13", "hvac_mode": HVACMode.HEAT},
137137
blocking=True,
138138
)
139139

tests/components/fibaro/test_cover.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ async def test_positionable_cover_setup(
3030
# Act
3131
await init_integration(hass, mock_config_entry)
3232
# Assert
33-
entry = entity_registry.async_get("cover.room_1_test_cover_3")
33+
entry = entity_registry.async_get("cover.room_1_test_cover_2")
3434
assert entry
3535
assert entry.supported_features == (
3636
CoverEntityFeature.OPEN
3737
| CoverEntityFeature.CLOSE
3838
| CoverEntityFeature.STOP
3939
| CoverEntityFeature.SET_POSITION
4040
)
41-
assert entry.unique_id == "hc2_111111.3"
41+
assert entry.unique_id == "hc2_111111.2"
4242
assert entry.original_name == "Room 1 Test cover"
4343

4444

@@ -59,7 +59,7 @@ async def test_cover_opening(
5959
# Act
6060
await init_integration(hass, mock_config_entry)
6161
# Assert
62-
assert hass.states.get("cover.room_1_test_cover_3").state == CoverState.OPENING
62+
assert hass.states.get("cover.room_1_test_cover_2").state == CoverState.OPENING
6363

6464

6565
async def test_cover_opening_closing_none(
@@ -80,7 +80,7 @@ async def test_cover_opening_closing_none(
8080
# Act
8181
await init_integration(hass, mock_config_entry)
8282
# Assert
83-
assert hass.states.get("cover.room_1_test_cover_3").state == CoverState.OPEN
83+
assert hass.states.get("cover.room_1_test_cover_2").state == CoverState.OPEN
8484

8585

8686
async def test_cover_closing(
@@ -101,7 +101,7 @@ async def test_cover_closing(
101101
# Act
102102
await init_integration(hass, mock_config_entry)
103103
# Assert
104-
assert hass.states.get("cover.room_1_test_cover_3").state == CoverState.CLOSING
104+
assert hass.states.get("cover.room_1_test_cover_2").state == CoverState.CLOSING
105105

106106

107107
async def test_cover_setup(

0 commit comments

Comments
 (0)