Skip to content

Commit

Permalink
Merge pull request #13 from blagasz/patch-1
Browse files Browse the repository at this point in the history
to_JSON for TelegramShort
  • Loading branch information
ganehag authored May 14, 2019
2 parents 4d4d998 + d2236f7 commit f248942
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meterbus/telegram_short.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,13 @@ def __iter__(self):
yield self._header.aField.parts[0]
yield self.compute_crc()
yield self._header.stopField.parts[0]

@property
def interpreted(self):
return {
'head': self.header.interpreted
}

def to_JSON(self):
return json.dumps(self.interpreted, sort_keys=True, indent=4, use_decimal=True)

0 comments on commit f248942

Please sign in to comment.