Skip to content

Commit

Permalink
fix pip
Browse files Browse the repository at this point in the history
  • Loading branch information
m4dm4rtig4n committed Oct 15, 2021
1 parent 7593485 commit 0313da0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
11 changes: 4 additions & 7 deletions app/myenedis.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ def myEnedis(cur, con, client,last_activation_date=datetime.now(pytz.timezone('E

def forceRound(x, n):
import decimal
import numpy as np
return np.around(x, n).astype('float64')

# d = decimal.Decimal(repr(x))
# targetdigit = decimal.Decimal("1e%d" % -n)
# chopped = d.quantize(targetdigit, decimal.ROUND_DOWN)
# return float(chopped.astype('float64'))
d = decimal.Decimal(repr(x))
targetdigit = decimal.Decimal("1e%d" % -n)
chopped = d.quantize(targetdigit, decimal.ROUND_DOWN)
return float(chopped)

price = {
"BASE": main.consumption_price_base,
Expand Down
3 changes: 1 addition & 2 deletions app/requirement.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
paho-mqtt==1.5.1
python-dateutil==2.8.1
requests==2.22.0
pytz==2021.1
numpy==1.21.1
pytz==2021.1

0 comments on commit 0313da0

Please sign in to comment.