From a9816914d905d9443af32ab00ca4e2d1db753546 Mon Sep 17 00:00:00 2001 From: Brian Berg Date: Mon, 27 Jul 2020 17:59:38 -0400 Subject: [PATCH] fix(sensors): fix recent payout sensor value - to be payout amount minus mining fee --- custom_components/nicehash/nicehash.py | 4 ++-- custom_components/nicehash/payout_sensors.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/nicehash/nicehash.py b/custom_components/nicehash/nicehash.py index ba6a20a..95fe8ca 100644 --- a/custom_components/nicehash/nicehash.py +++ b/custom_components/nicehash/nicehash.py @@ -64,8 +64,8 @@ class Payout: self.id = data.get("id") self.currency = "Unknown" self.created = data.get("created") - self.amount = data.get("amount") - self.fee = data.get("feeAmount") + self.amount = float(data.get("amount")) + self.fee = float(data.get("feeAmount")) self.account_type = "Unknown" # Currency currency = data.get("currency") diff --git a/custom_components/nicehash/payout_sensors.py b/custom_components/nicehash/payout_sensors.py index b895442..ff71913 100644 --- a/custom_components/nicehash/payout_sensors.py +++ b/custom_components/nicehash/payout_sensors.py @@ -83,7 +83,7 @@ class RecentMiningPayoutSensor(Entity): self._amount = 0.00 self._fee = 0.00 - return self._amount + return self._amount - self._fee @property def icon(self):