[python] Typo

This commit is contained in:
giuliof 2019-07-28 16:48:21 +02:00
parent 97e932b2f7
commit 364d6479e8
1 changed files with 4 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import matplotlib.dates as pld
# TMP is in different database, this is stupid: merge all in a single database
HDD_LABELS = ('sda','sdb','sdc','sdd')
CORE_LABELS = ('core0', 'core1', 'core2', 'core3')
TMP_LABELS_AMB = ('ambtmp')
TMP_LABELS_AMB = ('ambtmp',)
# Remote codes
CLIMA_CODES = {'freddo' : 0x4dc0bf, 'caldo' : 0x4d4033, 'spegni' : 0x4d841f}
@ -47,7 +47,7 @@ def getRoomTmp():
except Exception as e:
tmp = None
return {TMP_LABELS_AMB : tmp}
return dict(zip(TMP_LABELS_AMB, [tmp]))
def setClimaStatus(status):
dgh = dg.DomoticGateway()
@ -66,10 +66,9 @@ def setClimaStatus(status):
payload.append(0x00)
dgh.sendCommand('CMD_CLIMA', payload)
def plotData(data, name):
# Plot HDD data
def plotData(data, labels, name):
fig, ax = plt.subplots(nrows=1, ncols=1)
for i in data:
for i in labels:
ma = data[i].rolling(10).mean() # calculate moving average
ax.plot(data['datetime'], ma, linewidth=1.5, label=i)
ax.axvline('00:00', color='k', linestyle='--')