API of beradio

class beradio.protocol.BERadioProtocol2(network_id=None, gateway_id=None)

Example payload:

d1:#i999e1:_2:h11:hli488ei572ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee

Decoded:

{'w': 10677, 'h': [488, 572], '#': 999, 't': [2163, 1925, 1092, 1354], '_': 'h1'}

Mapped:

{
    "meta": {
        "node": "999",
        "profile": "h1",
        "protocol": "beradio2",
        "network": "efc54ed2-b010-42ee-bfb6-183f148885f1",
        "gateway": "tug22"
    },
    "data": {
        "wght1": 106.77,
        "hum1": 488.0,
        "hum2": 572.0,
        "temp1": 21.63,
        "temp2": 19.25,
        "temp3": 10.92,
        "temp4": 13.54
    }
}
VERSION = 2
decode(payload)

Decode BERadio2 message.

>>> BERadioProtocol2().decode('d1:#i999e1:_2:h11:hli48800ei57200ee1:tli2163ei1925ei1092ei1354ee1:wi10677ee\0\r\n ')  
{'meta': {'protocol': 'beradio2', 'network': 'None', 'gateway': 'None', 'node': '999', 'time': ..., 'profile': 'h1'}, 'data': OrderedDict([('hum1', 488.0), ('hum2', 572.0), ('temp1', 21.63), ('temp2', 19.25), ('temp3', 10.92), ('temp4', 13.54), ('wght1', 106.77)])}  # noqa:E501
decode_value(value, rule)
encode_value(identifier, value)
encode_values(identifier, values)
get_envelope(node=None)
identifiers = {'#': {'attname': 'direct', 'convert': <class 'str'>, 'meta': True, 'name': 'node'}, '_': {'attname': 'direct', 'convert': <class 'str'>, 'meta': True, 'name': 'profile'}, 'h': {'name': 'hum', 'scale-decode': <function BERadioProtocol2.<lambda>>, 'scale-encode': <function BERadioProtocol2.<lambda>>}, 'l': {'name': 'loops', 'scale-decode': <function BERadioProtocol2.<lambda>>, 'scale-encode': <function BERadioProtocol2.<lambda>>}, 'r': {'name': 'rssi', 'scale-decode': <function BERadioProtocol2.<lambda>>, 'scale-encode': <function BERadioProtocol2.<lambda>>}, 't': {'name': 'temp', 'scale-decode': <function BERadioProtocol2.<lambda>>, 'scale-encode': <function BERadioProtocol2.<lambda>>}, 'w': {'name': 'wght', 'scale-decode': <function BERadioProtocol2.<lambda>>, 'scale-encode': <function BERadioProtocol2.<lambda>>}}

class beradio.message.BERadioMessage(nodeid, profile='h1')
clear()
classmethod decode(payload)
encode()
humidity(*args)
classmethod json(payload)
protocol_factory

alias of BERadioProtocol2

temperature(*args)
weight(*args)
class beradio.message.BERadioMessageDecoder(reassembly_timeout=None)
MODE_COLLECT = 1
MODE_EMIT = 2
REASSEMBLY_TIMEOUT = 2.5
assemble()
emit()
read(payload)
release()
subscribe(subscriber)
to_json(strip_time=False)
wait()
class beradio.message.ResettableTimer(interval, function)
make_timer()
reset()