minermedic/miner_results.py
def populate_fan_results(self, miner, fan_speeds):

        """
        Populates the Fan Results for a Miner
        :param miner: Miner Object
        :param fan_speeds: (List) of Fan Speeds for that Miner
        :return: None
        """

        fan_avg = 0
        fan_status_pct = 100

        try:

            # get the avg fan
            fan_avg = math_functions.get_average_of_list(fan_speeds, 0)
            if fan_avg < 101:
                if fan_avg == 0:
                    fan_avg = ""
                else:
                    fan_avg = str(fan_avg) + "%"

            for fs in fan_speeds:
                if fs <= 0:
                    fan_status_pct = fan_status_pct - (1/len(fan_speeds))

            if fan_status_pct < 0:
                fan_status_pct = 0

        except Exception as ex:
            logger.error(ex)

        self.set_result(miner, 'fan_status', fan_status_pct)
        self.set_result(miner, 'fan_speeds', fan_speeds)
        self.set_result(miner, 'fan_speeds_avg', fan_avg)

        Populates the Fan Results for a Miner
        :param miner: Miner Object
        :param fan_speeds: (List) of Fan Speeds for that Miner
        :return: None
        
Populates the Fan Results for a Miner
Populates the Fan Results for a Miner
def populate_fan_results(self, miner, fan_speeds):
        fan_avg = 0
        fan_status_pct = 100
        try:
            fan_avg = math_functions.get_average_of_list(fan_speeds, 0)
            if fan_avg < 101:
                if fan_avg == 0:
                    fan_avg = ""
                else:
                    fan_avg = str(fan_avg) + "%"
            for fs in fan_speeds:
                if fs <= 0:
                    fan_status_pct = fan_status_pct - (1/len(fan_speeds))
            if fan_status_pct < 0:
                fan_status_pct = 0
        except Exception as ex:
            logger.error(ex)
        self.set_result(miner, 'fan_status', fan_status_pct)
        self.set_result(miner, 'fan_speeds', fan_speeds)
        self.set_result(miner, 'fan_speeds_avg', fan_avg)
def populate_fan_results ( self , miner , fan_speeds ) : fan_avg = 0 fan_status_pct = 100 try : fan_avg = math_functions . get_average_of_list ( fan_speeds , 0 ) if fan_avg < 101 : if fan_avg == 0 : fan_avg = "" else : fan_avg = str ( fan_avg ) + "%" for fs in fan_speeds : if fs <= 0 : fan_status_pct = fan_status_pct - ( 1 / len ( fan_speeds ) ) if fan_status_pct < 0 : fan_status_pct = 0 except Exception as ex : logger . error ( ex ) self . set_result ( miner , 'fan_status' , fan_status_pct ) self . set_result ( miner , 'fan_speeds' , fan_speeds ) self . set_result ( miner , 'fan_speeds_avg' , fan_avg )
Populates the Fan Results for a Miner
Populates the Fan Results for a Miner
"""
        Populates the Fan Results for a Miner
        :param miner: Miner Object
        :param fan_speeds: (List) of Fan Speeds for that Miner
        :return: None
        """ # get the avg fan
None
self
miner
None
fan_speeds
(List) of Fan Speeds for that Miner
( List ) of Fan Speeds for that Miner