def _to_micros(dur):
    if hasattr(dur, 'total_seconds'):
        return int(dur.total_seconds() * 10e5)
    # Python 2.6
    return dur.microseconds + (dur.seconds + dur.days * 24 * 3600) * 1000000
Update the data from the thermostat.
dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/monitoring.py/_to_micros--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/thermostat/eq3btsmart.py/EQ3BTSmartThermostat.update