-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (22 loc) · 798 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*-coding:utf8 -*-
from matplotlib import pyplot as plt
from sensit_api import Sensit
def transpose(mat):
return zip(*mat)
if __name__ == "__main__" :
sens = Sensit()
dev = sens.devices[0]
# f, (ax1, ax2) = plt.subplots(2, sharex=True)
plt.title("Sensit data")
temps = [(m.date, m.value) for m in dev.sound(begin="2015-07-01T00:00Z", end=-1)]
dates, values = transpose(temps)
plt.scatter(dates, values, label="sound")
plt.legend(loc="best")
# sounds = [(m.date, m.value) for m in dev.sound(begin=-1, end=-1)]
# dates, values = transpose(sounds)
# ax2.plot(dates, values, label="sound")
# motions = [(m.date, m.value) for m in dev.motion(begin=-1, end=-1)]
# dates, values = transpose(motions)
# ax2.plot(dates, values, label="motion")
# ax2.legend(loc="best")
plt.show()