Skip to content

Commit

Permalink
Force FullEntity.entity to be an int and not sometimes a string
Browse files Browse the repository at this point in the history
  • Loading branch information
joolean committed Aug 7, 2021
1 parent 6dc1e04 commit 665a7c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hslog/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ def block_start(
ps.current_block = block
return block

def full_entity(self, ps: ParsingState, ts, entity_id: int, card_id: str):
def _full_entity(self, ps: ParsingState, ts, entity_id: int, card_id: str):
ps.entity_packet = packets.FullEntity(ts, entity_id, card_id)
ps.register_packet(ps.entity_packet)

Expand All @@ -482,9 +482,11 @@ def full_entity(self, ps: ParsingState, ts, entity_id: int, card_id: str):

return ps.entity_packet

def full_entity_update(self, ps: ParsingState, ts, entity, card_id):
entity_id = ps.parse_entity_id(entity)
return self.full_entity(ps, ts, entity_id, card_id)
def full_entity(self, ps: ParsingState, ts, entity_id: str, card_id: str):
return self._full_entity(ps, ts, int(entity_id), card_id)

def full_entity_update(self, ps: ParsingState, ts, entity_id: str, card_id: str):
return self._full_entity(ps, ts, ps.parse_entity_id(entity_id), card_id)

@staticmethod
def show_entity(ps: ParsingState, ts, entity, card_id):
Expand Down

0 comments on commit 665a7c3

Please sign in to comment.