mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Limit entity platform entity service to same integration (#37313)
This commit is contained in:
parent
a015e551eb
commit
d08d00daa7
@ -517,7 +517,11 @@ class EntityPlatform:
|
|||||||
"""Handle the service."""
|
"""Handle the service."""
|
||||||
await service.entity_service_call(
|
await service.entity_service_call(
|
||||||
self.hass,
|
self.hass,
|
||||||
self.hass.data[DATA_ENTITY_PLATFORM][self.platform_name],
|
[
|
||||||
|
plf
|
||||||
|
for plf in self.hass.data[DATA_ENTITY_PLATFORM][self.platform_name]
|
||||||
|
if plf.domain == self.domain
|
||||||
|
],
|
||||||
func,
|
func,
|
||||||
call,
|
call,
|
||||||
required_features,
|
required_features,
|
||||||
|
@ -882,6 +882,15 @@ async def test_platforms_sharing_services(hass):
|
|||||||
entity2 = MockEntity(entity_id="mock_integration.entity_2")
|
entity2 = MockEntity(entity_id="mock_integration.entity_2")
|
||||||
await entity_platform2.async_add_entities([entity2])
|
await entity_platform2.async_add_entities([entity2])
|
||||||
|
|
||||||
|
entity_platform3 = MockEntityPlatform(
|
||||||
|
hass,
|
||||||
|
domain="different_integration",
|
||||||
|
platform_name="mock_platform",
|
||||||
|
platform=None,
|
||||||
|
)
|
||||||
|
entity3 = MockEntity(entity_id="different_integration.entity_3")
|
||||||
|
await entity_platform3.async_add_entities([entity3])
|
||||||
|
|
||||||
entities = []
|
entities = []
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user