@@ -77,16 +77,16 @@ def catch():
77
77
if data ['is_load' ]:
78
78
# If you put money onto your account, save the amount of money as peak
79
79
r .set ("peak" , int (data ['amount' ]))
80
- r .set ("balance" , int (r . get ("balance" )) + int (data ['amount' ]))
80
+ r .set ("balance" , int (getRedisValue ("balance" )) + int (data ['amount' ]))
81
81
else :
82
82
# If money is withdrawn OR in case of refunds or chargebacks the peak won't be set
83
- r .set ("balance" , int (r . get ("balance" )) + int (data ['amount' ]))
83
+ r .set ("balance" , int (getRedisValue ("balance" )) + int (data ['amount' ]))
84
84
85
- if int (data ['amount' ]) > int (r . get ("peak" )):
85
+ if int (data ['amount' ]) > int (getRedisValue ("peak" )):
86
86
# Only if the current balance is greater than the saved peak, save it as peak
87
87
r .set ("peak" , int (data ['amount' ]))
88
88
else :
89
- r .set ("balance" , int (r . get ("balance" )) + int (data ['amount' ]))
89
+ r .set ("balance" , int (getRedisValue ("balance" )) + int (data ['amount' ]))
90
90
r .set ("peak" , max_bal )
91
91
92
92
notify_particle ()
@@ -102,8 +102,8 @@ def refresh():
102
102
103
103
def notify_particle ():
104
104
# The particle device gets notified about changes here
105
- peak_v = float (r . get ("peak" ))
106
- balance_v = float (r . get ("balance" ))
105
+ peak_v = float (getRedisValue ("peak" ))
106
+ balance_v = float (getRedisValue ("balance" ))
107
107
108
108
# If the balance exceeds the peak/below 0, then the servo/needle might break.
109
109
# Because of this, the angle's value gets checked before sending to particle.io
0 commit comments