Skip to content

Commit

Permalink
Add round to consumption and power
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Oct 21, 2020
1 parent df2c3ac commit 4b4097c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_gateway3/gateway3.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,8 @@ def process_message(self, data: dict):
elif prop == 'duration':
# xiaomi cube
payload[prop] = param['value'] / 1000.0
elif prop in ('consumption', 'power'):
payload[prop] = round(param['value'], 2)
else:
payload[prop] = param['value']

Expand Down

0 comments on commit 4b4097c

Please sign in to comment.