mirror of
https://github.com/home-assistant/core.git
synced 2025-06-27 00:17:10 +00:00

* Migrate legacy Ecobee notify service * Correct comment * Update homeassistant/components/ecobee/notify.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Use version to check latest entry being used * Use 6 months of deprecation * Add repair flow tests * Only allow migrate_notify fix flow * Simplify repair flow * Use ecobee data to refrence entry * Make entry attrubute puiblic * Use hass.data ro retrieve entry. * Only register issue when legacy service when it is use * Remove backslash * Use ws_client.send_json_auto_id * Cleanup * Import domain from notify integration * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update dependencies * Use Issue_registry fixture * remove `update_before_add` flag * Update homeassistant/components/ecobee/notify.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Update homeassistant/components/ecobee/notify.py * Update tests/components/ecobee/conftest.py Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> * Fix typo and import --------- Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
"""Repairs support for Ecobee."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMAIN
|
|
from homeassistant.components.repairs import RepairsFlow
|
|
from homeassistant.components.repairs.issue_handler import ConfirmRepairFlow
|
|
from homeassistant.core import HomeAssistant, callback
|
|
from homeassistant.helpers import issue_registry as ir
|
|
|
|
from .const import DOMAIN
|
|
|
|
|
|
@callback
|
|
def migrate_notify_issue(hass: HomeAssistant) -> None:
|
|
"""Ensure an issue is registered."""
|
|
ir.async_create_issue(
|
|
hass,
|
|
DOMAIN,
|
|
"migrate_notify",
|
|
breaks_in_ha_version="2024.11.0",
|
|
issue_domain=NOTIFY_DOMAIN,
|
|
is_fixable=True,
|
|
is_persistent=True,
|
|
translation_key="migrate_notify",
|
|
severity=ir.IssueSeverity.WARNING,
|
|
)
|
|
|
|
|
|
async def async_create_fix_flow(
|
|
hass: HomeAssistant,
|
|
issue_id: str,
|
|
data: dict[str, str | int | float | None] | None,
|
|
) -> RepairsFlow:
|
|
"""Create flow."""
|
|
assert issue_id == "migrate_notify"
|
|
return ConfirmRepairFlow()
|