Raise issue "does not support platform setup" (#93585)
* Raise issue on platform missing * Modify issue * Remove deprecation * Fix strings * Strings * Last strings * strings to commonpull/93723/head
parent
68c646be40
commit
c6feb30c31
|
@ -62,5 +62,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -314,5 +314,11 @@
|
|||
"smoke": "smoke",
|
||||
"sound": "sound",
|
||||
"vibration": "vibration"
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,5 +18,11 @@
|
|||
"update": {
|
||||
"name": "Update"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,5 +32,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,5 +34,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,5 +103,11 @@
|
|||
"temperature": { "name": "Target temperature" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,5 +76,11 @@
|
|||
"window": {
|
||||
"name": "Window"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,11 @@
|
|||
"_": {
|
||||
"name": "[%key:component::date::title%]"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,5 +41,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,5 +52,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,5 +62,11 @@
|
|||
"humidifier": {
|
||||
"name": "[%key:component::humidifier::entity_component::_::name%]"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,5 +86,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,5 +34,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,5 +159,11 @@
|
|||
"receiver": {
|
||||
"name": "Receiver"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -154,5 +154,11 @@
|
|||
"wind_speed": {
|
||||
"name": "[%key:component::sensor::entity_component::wind_speed::name%]"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,5 +24,11 @@
|
|||
"on": "[%key:common::state::on%]"
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,5 +24,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,5 +267,11 @@
|
|||
"wind_speed": {
|
||||
"name": "Wind speed"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,5 +13,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,5 +30,11 @@
|
|||
"outlet": {
|
||||
"name": "Outlet"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,5 +27,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,5 +4,11 @@
|
|||
"_": {
|
||||
"name": "[%key:component::time::title%]"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,5 +14,11 @@
|
|||
"firmware": {
|
||||
"name": "firmware"
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,5 +28,11 @@
|
|||
"returning": "Returning to dock"
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,5 +18,11 @@
|
|||
"performance": "Performance"
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,5 +62,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support": {
|
||||
"title": "[%key:common::issues::platform_integration_no_support_title%]",
|
||||
"description": "[%key:common::issues::platform_integration_no_support_description%]"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ from . import (
|
|||
from .device_registry import DeviceRegistry
|
||||
from .entity_registry import EntityRegistry, RegistryEntryDisabler, RegistryEntryHider
|
||||
from .event import async_call_later, async_track_time_interval
|
||||
from .issue_registry import IssueSeverity, async_create_issue
|
||||
from .typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
|
@ -211,6 +212,19 @@ class EntityPlatform:
|
|||
self.platform_name,
|
||||
self.domain,
|
||||
)
|
||||
async_create_issue(
|
||||
self.hass,
|
||||
self.domain,
|
||||
f"platform_integration_no_support_{self.domain}_{self.platform_name}",
|
||||
is_fixable=False,
|
||||
severity=IssueSeverity.ERROR,
|
||||
translation_key="platform_integration_no_support",
|
||||
translation_placeholders={
|
||||
"domain": self.domain,
|
||||
"platform": self.platform_name,
|
||||
},
|
||||
)
|
||||
|
||||
return
|
||||
|
||||
@callback
|
||||
|
|
|
@ -87,6 +87,10 @@
|
|||
"unknown_authorize_url_generation": "Unknown error generating an authorize URL.",
|
||||
"cloud_not_connected": "Not connected to Home Assistant Cloud."
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"platform_integration_no_support_title": "Platform support not supported",
|
||||
"platform_integration_no_support_description": "The {platform} platform for the {domain} integration does not support platform setup.\n\nPlease remove it from your configuration and restart Home Assistant to fix this issue."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ from homeassistant.helpers import (
|
|||
device_registry as dr,
|
||||
entity_platform,
|
||||
entity_registry as er,
|
||||
issue_registry as ir,
|
||||
)
|
||||
from homeassistant.helpers.entity import (
|
||||
DeviceInfo,
|
||||
|
@ -1458,7 +1459,9 @@ async def test_override_restored_entities(
|
|||
|
||||
|
||||
async def test_platform_with_no_setup(
|
||||
hass: HomeAssistant, caplog: pytest.LogCaptureFixture
|
||||
hass: HomeAssistant,
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
issue_registry: ir.IssueRegistry,
|
||||
) -> None:
|
||||
"""Test setting up a platform that does not support setup."""
|
||||
entity_platform = MockEntityPlatform(
|
||||
|
@ -1471,6 +1474,12 @@ async def test_platform_with_no_setup(
|
|||
"The mock-platform platform for the mock-integration integration does not support platform setup."
|
||||
in caplog.text
|
||||
)
|
||||
issue = issue_registry.async_get_issue(
|
||||
domain="mock-integration",
|
||||
issue_id="platform_integration_no_support_mock-integration_mock-platform",
|
||||
)
|
||||
assert issue
|
||||
assert issue.translation_key == "platform_integration_no_support"
|
||||
|
||||
|
||||
async def test_platforms_sharing_services(hass: HomeAssistant) -> None:
|
||||
|
|
Loading…
Reference in New Issue