Skip to content

Commit

Permalink
Update __init__.py (#57)
Browse files Browse the repository at this point in the history
Corrected consistency regarding usage of uppercase letters for Object_Id .
Resolved #43
  • Loading branch information
acigl authored Oct 28, 2020
1 parent 49f7ea0 commit 9e9abff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/remote_homeassistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,18 @@ async def forward_event(event):
if isinstance(entity_ids, str):
entity_ids = (entity_ids.lower(),)

entity_ids = self._entities.intersection(entity_ids)
entities = {entity_id.lower()
for entity_id in self._entities}

entity_ids = entities.intersection(entity_ids)

if not entity_ids:
return

if self._entity_prefix:
def _remove_prefix(entity_id):
domain, object_id = split_entity_id(entity_id)
object_id = object_id.replace(self._entity_prefix, '', 1)
object_id = object_id.replace(self._entity_prefix.lower(), '', 1)
return domain + '.' + object_id
entity_ids = {_remove_prefix(entity_id)
for entity_id in entity_ids}
Expand Down

0 comments on commit 9e9abff

Please sign in to comment.