8000 Merge branch 'dev' into select-selector-domain · home-assistant/core@67a320a · GitHub
[go: up one dir, main page]

Skip to content

Commit 67a320a

Browse files
authored
Merge branch 'dev' into select-selector-domain
2 parents 09d453c + 43a5c7d commit 67a320a

File tree

13 files changed

+308
-28
lines changed

13 files changed

+308
-28
lines changed

homeassistant/components/cloudflare/config_flow.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import pycfdns
1010
import voluptuous as vol
1111

12-
from homeassistant.components import persistent_notification
1312
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
1413
from homeassistant.const import CONF_API_TOKEN, CONF_ZONE
1514
from homeassistant.core import HomeAssistant
@@ -118,8 +117,6 @@ async def async_step_user(
118117
self, user_input: dict[str, Any] | None = None
119118
) -> ConfigFlowResult:
120119
"""Handle a flow initiated by the user."""
121-
persistent_notification.async_dismiss(self.hass, "cloudflare_setup")
122-
123120
errors: dict[str, str] = {}
124121

125122
if user_input is not None:

homeassistant/components/google_generative_ai_conversation/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from types import MappingProxyType
88
from typing import Any
99

10-
from google import genai # type: ignore[attr-defined]
10+
from google import genai
1111
from google.genai.errors import APIError, ClientError
1212
from requests.exceptions import Timeout
1313
import voluptuous as vol

homeassistant/components/home_connect/binary_sensor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def __init__(
244244
BSH_DOOR_STATE_LOCKED: False,
245245
BSH_DOOR_STATE_OPEN: True,
246246
},
247+
entity_registry_enabled_default=False,
247248
),
248249
)
249250
self._attr_unique_id = f"{appliance.info.ha_id}-Door"
@@ -283,7 +284,8 @@ async def async_added_to_hass(self) -> None:
283284
DOMAIN,
284285
f"deprecated_binary_common_door_sensor_{self.entity_id}",
285286
breaks_in_ha_version="2025.5.0",
286-
is_fixable=False,
287+
is_fixable=True,
288+
is_persistent=True,
287289
severity=IssueSeverity.WARNING,
288290
translation_key="deprecated_binary_common_door_sensor",
289291
translation_placeholders={

homeassistant/components/home_connect/strings.json

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,47 @@
134134
},
135135
"deprecated_binary_common_door_sensor": {
136136
"title": "Deprecated binary door sensor detected in some automations or scripts",
137-
"description": "The binary door sensor `{entity}`, which is deprecated, is used in the following automations or scripts:\n{items}\n\nA sensor entity with additional possible states is available and should be used going forward; Please use it on the above automations or scripts to fix this issue."
137+
"fix_flow": {
138+
"step": {
139+
"confirm": {
140+
"title": "[%key:component::home_connect::issues::deprecated_binary_common_door_sensor::title%]",
141+
"description": "The binary door sensor `{entity}`, which is deprecated, is used in the following automations or scripts:\n{items}\n\nA sensor entity with additional possible states is available and should be used going forward; Please use it on the above automations or scripts to fix this issue."
142+
}
143+
}
144+
}
138145
},
139146
"deprecated_command_actions": {
140147
"title": "The command related actions are deprecated in favor of the new buttons",
141-
"description": "The `pause_program` and `resume_program` actions have been deprecated in favor of new button entities, if the command is available for your appliance. Please update your automations, scripts and panels that use this action to use the button entities instead, and press on submit to fix the issue."
148+
"fix_flow": {
149+
"step": {
150+
"confirm": {
151+
"title": "[%key:component::home_connect::issues::deprecated_command_actions::title%]",
152+
"description": "The `pause_program` and `resume_program` actions have been deprecated in favor of new button entities, if the command is available for your appliance. Please update your automations, scripts and panels that use this action to use the button entities instead, and press on submit to fix the issue."
153+
}
154+
}
155+
}
142156
},
143-
"deprecated_program_switch": {
157+
"deprecated_program_switch_in_automations_scripts": {
144158
"title": "Deprecated program switch detected in some automations or scripts",
145-
"description": "Program switches are deprecated and {entity_id} is used in the following automations or scripts:\n{items}\n\nYou can use the active program select entity to run the program without any additional options and get the current running program on the above automations or scripts to fix this issue."
159+
"fix_flow": {
160+
"step": {
161+
"confirm": {
162+
"title": "[%key:component::home_connect::issues::deprecated_program_switch_in_automations_scripts::title%]",
163+
"description": "Program switches are deprecated and {entity_id} is used in the following automations or scripts:\n{items}\n\nYou can use the active program select entity to run the program without any additional options and get the current running program on the above automations or scripts to fix this issue."
164+
}
165+
}
166+
}
167+
},
168+
"deprecated_program_switch": {
169+
"title": "Deprecated program switch entities",
170+
"fix_flow": {
171+
"step": {
172+
"confirm": {
173+
"title": "[%key:component::home_connect::issues::deprecated_program_switch::title%]",
174+
"description": "The switch entity `{entity_id}` and all the other program switches are deprecated.\n\nPlease use the active program select entity instead."
175+
}
176+
}
177+
}
146178
},
147179
"deprecated_set_program_and_option_actions": {
148180
"title": "The executed action is deprecated",

homeassistant/components/home_connect/switch.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ def __init__(
266266
super().__init__(
267267
coordinator,
268268
appliance,
269-
SwitchEntityDescription(key=EventKey.BSH_COMMON_ROOT_ACTIVE_PROGRAM),
269+
SwitchEntityDescription(
270+
key=EventKey.BSH_COMMON_ROOT_ACTIVE_PROGRAM,
271+
entity_registry_enabled_default=False,
272+
),
270273
)
271274
self._attr_name = f"{appliance.info.name} {desc}"
272275
self._attr_unique_id = f"{appliance.info.ha_id}-{desc}"
@@ -304,11 +307,12 @@ async def async_added_to_hass(self) -> None:
304307
async_create_issue(
305308
self.hass,
306309
DOMAIN,
307-
f"deprecated_program_switch_{self.entity_id}",
310+
f"deprecated_program_switch_in_automations_scripts_{self.entity_id}",
308311
breaks_in_ha_version="2025.6.0",
309-
is_fixable=False,
312+
is_fixable=True,
313+
is_persistent=True,
310314
severity=IssueSeverity.WARNING,
311-
translation_key="deprecated_program_switch",
315+
translation_key="deprecated_program_switch_in_automations_scripts",
312316
translation_placeholders={
313317
"entity_id": self.entity_id,
314318
"items": "\n".join(items_list),
@@ -317,12 +321,34 @@ async def async_added_to_hass(self) -> None:
317321

318322
async def async_will_remove_from_hass(self) -> None:
319323
"""Call when entity will be removed from hass."""
324+
async_delete_issue(
325+
self.hass,
326+
DOMAIN,
327+
f"deprecated_program_switch_in_automations_scripts_{self.entity_id}",
328+
)
320329
async_delete_issue(
321330
self.hass, DOMAIN, f"deprecated_program_switch_{self.entity_id}"
322331
)
323332

333+
def create_action_handler_issue(self) -> None:
334+
"""Create deprecation issue."""
335+
async_create_issue(
336+
self.hass,
337+
DOMAIN,
338+
f"deprecated_program_switch_{self.entity_id}",
339+
breaks_in_ha_version="2025.6.0",
340+
is_fixable=True,
341+
is_persistent=True,
342+
severity=IssueSeverity.WARNING,
343+
translation_key="deprecated_program_switch",
344+
translation_placeholders={
345+
"entity_id": self.entity_id,
346+
},
347+
)
348+
324349
async def async_turn_on(self, **kwargs: Any) -> None:
325350
"""Start the program."""
351+
self.create_action_handler_issue()
326352
try:
327353
await self.coordinator.client.start_program(
328354
self.appliance.info.ha_id, program_key=self.program.key
@@ -339,6 +365,7 @@ async def async_turn_on(self, **kwargs: Any) -> None:
339365

340366
async def async_turn_off(self, **kwargs: Any) -> None:
341367
"""Stop the program."""
368+
self.create_action_handler_issue()
342< 10000 code>369
try:
343370
await self.coordinator.client.stop_program(self.appliance.info.ha_id)
344371
except HomeConnectError as err:

homeassistant/components/linkplay/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"integration_type": "hub",
88
"iot_class": "local_polling",
99
"loggers": ["linkplay"],
10-
"requirements": ["python-linkplay==0.2.1"],
10+
"requirements": ["python-linkplay==0.2.2"],
1111
"zeroconf": ["_linkplay._tcp.local."]
1212
}

homeassistant/components/remote_calendar/config_flow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ async def async_step_user(
4242
self._async_abort_entries_match(
4343
{CONF_CALENDAR_NAME: user_input[CONF_CALENDAR_NAME]}
4444
)
45+
if user_input[CONF_URL].startswith("webcal://"):
46+
user_input[CONF_URL] = user_input[CONF_URL].replace(
47+
"webcal://", "https://", 1
48+
)
4549
self._async_abort_entries_match({CONF_URL: user_input[CONF_URL]})
4650
client = get_async_client(self.hass)
4751
try:

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/home_connect/test_binary_sensor.py

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests for home_connect binary_sensor entities."""
22

33
from collections.abc import Awaitable, Callable
4+
from http import HTTPStatus
45
from unittest.mock import AsyncMock, MagicMock
56

67
from aiohomeconnect.model import (
@@ -39,6 +40,7 @@
3940
from homeassistant.setup import async_setup_component
4041

4142
from tests.common import MockConfigEntry
43+
from tests.typing import ClientSessionGenerator
4244

4345

4446
@pytest.fixture
@@ -165,6 +167,7 @@ def get_status_side_effect(ha_id: str):
165167
assert len(new_entity_entries) > len(entity_entries)
166168

167169

170+
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
168171
@pytest.mark.parametrize("appliance", ["Washer"], indirect=True)
169172
async def test_binary_sensors_entity_availability(
170173
hass: HomeAssistant,
@@ -219,6 +222,7 @@ async def test_binary_sensors_entity_availability(
219222
assert state.state != STATE_UNAVAILABLE
220223

221224

225+
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
222226
@pytest.mark.parametrize("appliance", ["Washer"], indirect=True)
223227
@pytest.mark.parametrize(
224228
("value", "expected"),
@@ -402,15 +406,15 @@ async def test_connected_sensor_functionality(
402406

403407

404408
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
405-
async def test_create_issue(
409+
async def test_create_door_binary_sensor_deprecation_issue(
406410
hass: HomeAssistant,
407411
config_entry: MockConfigEntry,
408412
integration_setup: Callable[[MagicMock], Awaitable[bool]],
409413
setup_credentials: None,
410414
client: MagicMock,
411415
issue_registry: ir.IssueRegistry,
412416
) -> None:
413-
"""Test we create an issue when an automation or script is using a deprecated entity."""
417+
"""Test that we create an issue when an automation or script is using a door binary sensor entity."""
414418
entity_id = "binary_sensor.washer_door"
415419
issue_id = f"deprecated_binary_common_door_sensor_{entity_id}"
416420

@@ -464,3 +468,76 @@ async def test_create_issue(
464468
# Assert the issue is no longer present
465469
assert not issue_registry.async_get_issue(DOMAIN, issue_id)
466470
assert len(issue_registry.issues) == 0
471+
472+
473+
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
474+
async def test_door_binary_sensor_deprecation_issue_fix(
475+
hass: HomeAssistant,
476+
config_entry: MockConfigEntry,
477+
integration_setup: Callable[[MagicMock], Awaitable[bool]],
478+
setup_credentials: None,
479+
client: MagicMock,
480+
issue_registry: ir.IssueRegistry,
481+
hass_client: ClientSessionGenerator,
482+
) -> None:
483+
"""Test that we create an issue when an automation or script is using a door binary sensor entity."""
484+
entity_id = "binary_sensor.washer_door"
485+
issue_id = f"deprecated_binary_common_door_sensor_{entity_id}"
486+
487+
assert await async_setup_component(
488+
hass,
489+
automation.DOMAIN,
490+
{
491+
automation.DOMAIN: {
492+
"alias": "test",
493+
"trigger": {"platform": "state", "entity_id": entity_id},
494+
"action": {
495+
"action": "automation.turn_on",
496+
"target": {
497+
"entity_id": "automation.test",
498+
},
499+
},
500+
}
501+
},
502+
)
503+
assert await async_setup_component(
504+
hass,
505+
script.DOMAIN,
506+
{
507+
script.DOMAIN: {
508+
"test": {
509+
"sequence": [
510+
{
511+
"condition": "state",
512+
"entity_id": entity_id,
513+
"state": "on",
514+
},
515+
],
516+
}
517+
}
518+
},
519+
)
520+
521+
assert config_entry.state == ConfigEntryState.NOT_LOADED
522+
assert await integration_setup(client)
523+
assert config_entry.state == ConfigEntryState.LOADED
524+
525+
assert automations_with_entity(hass, entity_id)[0] == "automation.test"
526+
assert scripts_with_entity(hass, entity_id)[0] == "script.test"
527+
528+
assert len(issue_registry.issues) == 1
529+
issue = issue_registry.async_get_issue(DOMAIN, issue_id)
530+
assert issue
531+
532+
_client = await hass_client()
533+
resp = await _client.post(
534+
"/api/repairs/issues/fix",
535+
json={"handler": DOMAIN, "issue_id": issue.issue_id},
536+
)
537+
assert resp.status == HTTPStatus.OK
538+
flow_id = (await resp.json())["flow_id"]
539+
resp = await _client.post(f"/api/repairs/issues/fix/{flow_id}")
540+
541+
# Assert the issue is no longer present
542+
assert not issue_registry.async_get_issue(DOMAIN, issue_id)
543+
assert len(issue_registry.issues) == 0

0 commit comments

Comments
 (0)
0