def updateBatteryCapacity(self, capacity):
    with self.lock:
        self.batteryCapacity = capacity
        self.lastMessageTime = float(time.time())
def updateBatteryCapacity(self, capacity):
    with self.lock:
        self.batteryCapacity = capacity
        self.lastMessageTime = float(time.time())