Skip to content

Commit

Permalink
Repairs: Ignore invalid entity IDs in all cases (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored May 26, 2023
1 parent 52e1d66 commit f5c6d7d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ENTITY_MATCH_NONE,
EVENT_COMPONENT_LOADED,
)
from homeassistant.core import valid_entity_id
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_component import DATA_INSTANCES, EntityComponent
Expand Down Expand Up @@ -106,6 +107,7 @@ async def async_inspect(self) -> None:
),
)
and entity_id not in entity_ids
and valid_entity_id(entity_id)
)
}:
self.async_create_issue(
Expand Down
2 changes: 2 additions & 0 deletions custom_components/spook/repairs/group_unknown_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ENTITY_MATCH_NONE,
EVENT_COMPONENT_LOADED,
)
from homeassistant.core import valid_entity_id
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.entity_platform import DATA_ENTITY_PLATFORM, EntityPlatform

Expand Down Expand Up @@ -83,6 +84,7 @@ async def async_inspect(self) -> None:
("device_tracker.", "group.", "scene."),
)
and entity_id not in entity_ids
and valid_entity_id(entity_id)
)
}:
self.async_create_issue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ENTITY_MATCH_NONE,
EVENT_COMPONENT_LOADED,
)
from homeassistant.core import callback
from homeassistant.core import callback, valid_entity_id
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect

Expand Down Expand Up @@ -117,6 +117,7 @@ async def async_inspect(self) -> None:
),
)
and entity_id not in entity_ids
and valid_entity_id(entity_id)
)
}:
title = "Overview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ENTITY_MATCH_NONE,
EVENT_COMPONENT_LOADED,
)
from homeassistant.core import valid_entity_id
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_component import DATA_INSTANCES, EntityComponent
Expand Down Expand Up @@ -107,6 +108,7 @@ async def async_inspect(self) -> None:
),
)
and entity_id not in entity_ids
and valid_entity_id(entity_id)
)
}:
self.async_create_issue(
Expand Down

0 comments on commit f5c6d7d

Please sign in to comment.