parse telemetry data with pycayennelpp

This commit is contained in:
Florent de Lamotte 2025-05-14 14:48:11 +02:00
parent 7ecd237377
commit 0aa586fe4e
2 changed files with 5 additions and 2 deletions

View file

@ -18,7 +18,7 @@ classifiers = [
]
license = "MIT"
license-files = ["LICEN[CS]E*"]
dependencies = [ "bleak", "pyserial-asyncio" ]
dependencies = [ "bleak", "pyserial-asyncio", "pycayennelpp" ]
[project.optional-dependencies]
dev = ["pytest", "pytest-asyncio"]

View file

@ -1,6 +1,7 @@
import sys
import logging
import asyncio
from cayennelpp import LppFrame
from typing import Any, Optional, Dict
from .events import Event, EventType, EventDispatcher
from .packets import PacketType
@ -378,7 +379,9 @@ class MessageReader:
res = {}
res["pubkey_pre"] = data[2:8].hex()
res["data"] = data[8:12].hex()
buf = data[8:]
res["data"] = buf.hex()
res["lpp"] = LppFrame().from_bytes(buf)
attributes = {
"data" : res["data"],