Skip to content

Commit 9e9abff

Browse files
authored
Update __init__.py (#57)
Corrected consistency regarding usage of uppercase letters for Object_Id . Resolved #43
1 parent 49f7ea0 commit 9e9abff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

custom_components/remote_homeassistant/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,18 @@ async def forward_event(event):
324324
if isinstance(entity_ids, str):
325325
entity_ids = (entity_ids.lower(),)
326326

327-
entity_ids = self._entities.intersection(entity_ids)
327+
entities = {entity_id.lower()
328+
for entity_id in self._entities}
329+
330+
entity_ids = entities.intersection(entity_ids)
328331

329332
if not entity_ids:
330333
return
331334

332335
if self._entity_prefix:
333336
def _remove_prefix(entity_id):
334337
domain, object_id = split_entity_id(entity_id)
335-
object_id = object_id.replace(self._entity_prefix, '', 1)
338+
object_id = object_id.replace(self._entity_prefix.lower(), '', 1)
336339
return domain + '.' + object_id
337340
entity_ids = {_remove_prefix(entity_id)
338341
for entity_id in entity_ids}

0 commit comments

Comments
 (0)