              current_power = int(f.read()) / 1e6
          elif get_battery_status() == 'Discharging':
            # If the battery is discharging, we can use this measurement
            # On C2: this is low by about 10-15%, probably mostly due to UNO draw not being factored in
            current_power = ((get_battery_voltage() / 1000000) * (get_battery_current() / 1000000))
          elif (self.next_pulsed_measurement_time is not None) and (self.next_pulsed_measurement_time <= now):
            # TODO: Figure out why this is off by a factor of 3/4???
            FUDGE_FACTOR = 1.33
  
            # Turn off charging for about 10 sec in a thread that does not get killed on SIGINT, and perform measurement here to avoid blocking thermal
 
</s> remove         current_power = 0
        if TICI:
          with open("/sys/class/hwmon/hwmon1/power1_input") as f:
            current_power = int(f.read()) / 1e6
        elif get_battery_status() == 'Discharging':
 </s> add         current_power = HARDWARE.get_current_power_draw()
        if current_power is not None:
          pass
        elif HARDWARE.get_battery_status() == 'Discharging': </s> remove               set_battery_charging(False)
 </s> add               HARDWARE.set_battery_charging(False) </s> remove                 voltages.append(get_battery_voltage())
                currents.append(get_battery_current())
 </s> add                 voltages.append(HARDWARE.get_battery_voltage())
                currents.append(HARDWARE.get_battery_current()) </s> remove               set_battery_charging(True)
 </s> add               HARDWARE.set_battery_charging(True) </s> remove     msg.thermal.batteryPercent = get_battery_capacity()
    msg.thermal.batteryStatus = get_battery_status()
    msg.thermal.batteryCurrent = get_battery_current()
    msg.thermal.batteryVoltage = get_battery_voltage()
    msg.thermal.usbOnline = get_usb_present()
 </s> add     msg.thermal.batteryPercent = HARDWARE.get_battery_capacity()
    msg.thermal.batteryStatus = HARDWARE.get_battery_status()
    msg.thermal.batteryCurrent = HARDWARE.get_battery_current()
    msg.thermal.batteryVoltage = HARDWARE.get_battery_voltage()
    msg.thermal.usbOnline = HARDWARE.get_usb_present()
          current_power = ((HARDWARE.get_battery_voltage() / 1000000) * (HARDWARE.get_battery_current() / 1000000))
              current_power = int(f.read()) / 1e6
          elif get_battery_status() == 'Discharging':
            # If the battery is discharging, we can use this measurement
            # On C2: this is low by about 10-15%, probably mostly due to UNO draw not being factored in
          current_power = ((HARDWARE.get_battery_voltage() / 1000000) * (HARDWARE.get_battery_current() / 1000000))
          elif (self.next_pulsed_measurement_time is not None) and (self.next_pulsed_measurement_time <= now):
            # TODO: Figure out why this is off by a factor of 3/4???
            FUDGE_FACTOR = 1.33
  
            # Turn off charging for about 10 sec in a thread that does not get killed on SIGINT, and perform measurement here to avoid blocking thermal
keep keep keep keep replace keep keep keep keep keep
 Move thermald hardware calls into HW abstraction layer (#2630)

* abstracted away hardware calls

* oopsie

* remove bugs

* remove bugs #2

* fix unit test

* removed print

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/thermald/power_monitoring.py