MCPcopy Create free account
hub / github.com/antirez/freakwan / encode_data

Method encode_data

sensor.py:67–71  ·  view source on GitHub ↗
(self,data)

Source from the content-addressed store, hash-verified

65 # as a floating point number, but it is type-specific), so multiple readings
66 # are sent in a single message.
67 def encode_data(self,data):
68 encoded = bytes()
69 for keytype in data:
70 encoded += struct.pack("<Bf",keytype,data[keytype])
71 return encoded
72
73 def send_sample_dht22(self):
74 d = dht.DHT22(Pin(self.config['dht_pin']))

Callers 1

send_sample_dht22Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected