(self,data)
| 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'])) |